March 2007 Archives

AddThis Social Bookmark Button

One of the cool features available in Java 6.0 (Mustang) is the ‘Java Compiler API’. This API is a result of the JSR (Java Specification Request) 199 which proposes that there must be a standard way to compile java source files. The result of the JSR is the new ‘Java Compiler API’ and one can use this new feature to compile java source files from within java files. Previously developers were depending on the low-level issues like starting a process representing the javac.exe. Though this feature is not intended to every one, Editors or IDE (Integrated Development Environment) can make much use of this new feature for compiling Java source files in a better manner. Here Shunmuga Raja explains in very detail.
The Java 6.0 Compiler API

Robert Cooper

AddThis Social Bookmark Button

Ok, it has been a while since I have seen a tool that made me go, “Wow, why am I not using this,” but I have a new one: Enuciate. This is a “cooker” that will take a Java service implementation as a set of POJOs, or JSR-181 annotated stuff, and spit out a WAR file with an Xfire backed SOAP service, a REST service, a JSON service and some fairly nice looking Docs scraped off the JavaDoc. The rest stuff is annotation based, and I wonder if there are plans to move it to a JSR-311 based system. The cook system is broken out into modules, and I am thinking making a GWT RPC service module would be a cool thing too.

AddThis Social Bookmark Button

Spring 2.0 introduces Portlet MVC Framework. For more details about the portlet framework read the sun’s documentation. The Portlet MVC framework is a mirror image of the Web MVC framework.

The main way in which portlet workflow differs from servlet workflow is that the request to the portlet can have two distinct phases: the action phase and the render phase. The action phase is executed only once and is where any ‘backend’ changes or actions occur, such as making changes in a database. The render phase then produces what is displayed to the user each time the display is refreshed. The critical point here is that for a single overall request, the action phase is executed only once, but the render phase may be executed multiple times. This provides (and requires) a clean separation between the activities that modify the persistent state of your system and the activities that generate what is displayed to the user.

http://www.springframework.org/docs/reference/portlet.html

Spring Articles

Tim O

AddThis Social Bookmark Button

Update 3/30/2007: I am “an asshat”, I spelled Hani’s name wrong in the original post. Was spelling Suleiman as Sulemani. Maybe it is the Spring 2.0 XML that is curdling my brain?

If you haven’t already, you should read Sierra’s blog and then write her a quick note of encouragement. If you don’t know, she’s the brains behind the heads up series, and, trust me, I know you have a copy on your desk even if you are too embarrassed to admit it. Those books are both incredibly effective and dense. Everyone who has a copy should take a moment, and thank her for her contribution.

But, this entry isn’t about Ms. Sierra, it is really about another prominent member of the community who’s under some fire, in part, because of the experiences of Ms. Sierra. Hani Suleiman, most of the readers of this blog, probably know who Hani is, and if the name doesn’t ring a bell, than saying “BileBlog” probably will. You’ve read it, and if you haven’t, then Google it. I’m not going to link to it, not because I disapprove, but because it does contain some obscenities. In addition to writing the BileBlog, Hani also sits on the Executive Committee of the Java Community Process.

Tim O

AddThis Social Bookmark Button

Sun’s Chief Open Source Officer Simon Phipps comments on some of the revisions in GPLv3. In his entry he points to the clarification re: software-as-a-service. He also writes:

I’d been expecting the final draft; this is now an extra interim draft, and we’ll not see the final version until the summer. And there are several signs that we’ll see more frequent updates to the license - there are indications that the DRM stuff might be extended to different kinds of devices, for example. All very interesting, I know there will be a lot of discussion about this inside Sun over the next few weeks.

Also, over at O’Reilly Radar Allison Randall comments on the revisions. She’s specifically addresses the updated definition of “consumer devices”.

Read the GPLv3 redline here.

AddThis Social Bookmark Button

The Spring IDE team has released Spring IDE 2.0 M3, which among other new features includes the highly-anticipated Spring Web Flow graphical visualizer and editor. The new support allows developers to edit XML-based flow definitions graphically, and enables greater productivity and communication with end users.
http://www.springframework.org/node/429
Spring Articles

Shashank Tiwari

AddThis Social Bookmark Button

The March 26, 2007 issue of InfoWorld has reviewed a bunch of Java IDEs and passed its latest judgment. The report is accessible online at http://akamai.infoworld.com/pdf/special_report/2007/13SRjava.pdf.

There are 2 main conclusions - (1) Eclipse base IDEs are doing better than those not based on it and (2) Borland’s JBuilder 2007 is the best IDE in the market today.

While the Eclipse vs. NetBeans debate has surfaced again and again in the past, it seems like the current trend is that Eclipse has been re-categorized as a framework rather than an IDE and specific implementations or aggregation of plugins based on the Eclipse framework are the ones being compared with NetBeans.
Also, the InfoWorld review has praised NetBeans without giving it that many credits. It has been specifically mentioned that the version 6.0, which is in beta, promises to be a great option.
Towards the end three alternatives, to the IBM, Borland and the NetBeans IDEs, are also enlisted. These are Eclipse, as such, (perhaps the MyEclipse distribution), IntelliJ and Oracle’s JDeveloper. IntelliJ is praised as being a great IDE for pure coding.

The article includes a tabular comparison of the three main IDEs it evaluates. The table is a good way to quickly assess the capability of the IDEs and perhaps one could use it to quickly pick a suitable IDE for ones needs .

Paul Browne

AddThis Social Bookmark Button

First up, this isn’t a Java post, but it should be of interest to you as a Java developer. O’Reilly has many categories of blogs, but not (yet) a Web2-dev one. If your world view doesn’t include Web 2, RSS or online development tools then stop reading now.

Like many other people, I’ve been playing a bit with Yahoo pipes : Yahoo Pipes in 10 easy steps. It’s a very good example of a Web 2 tool . It’s beta, and does what it says on the tin ; It allows you to combine / filter / clone and edit RSS streams. In the same way SQL allows you to query a database, pipes allows you to query XML (or to be more precise RSS) streams for the data you want.

Yahoo Pipes is worth checking out for the following reasons:

  • The user interface (finally) puts Gmail to shame. Just how do they generate the dynamic / curvy pipes linking the boxes?
  • It’s completely graphic. Users with at a ‘power user of Excel’ level can generate streams that would previously have taken an experienced programmer a number of days.
  • It’s another piece on the Web2 infrastructure. All other desktop apps have migrated to the web. It was just a matter of time before developer tools did as well. Does it make sense for you? Your call.

Pipes, for the reasons below, is not yet going to displace teams of Java people who do nothing but code RSS streams all day. Before, the choice on many IT projects was Build , Buy or use Open Source (or various combinations of those three). Online Web 2 apps (of which pipes is only one example) gives a fourth option to put into the mix.

So what does Yahoo pipes need to overcome the ‘toy’ label and become a ’serious’ option for IT projects?

  • The problem is, it’s free.How do Yahoo intend making money out of Pipes? More accurately , will they make enough money so that my project can still use it in 3 years time.
  • You’re stuck with Yahoo.Meaning, if you build against pipes, you’re stuck with them. Even in the database world, it is possible, if expensive to switch product supplier. I’d love Yahoo to open source pipes to solve this dilemma, and allow them to build a business around the ‘pipes hosting’ part.
  • It’s completely graphic. This is mainly a good thing (see above), but no doubt you’d still like the option (like most developers) to see / edit the generated code.
  • It’s hard to extend. If there is a way of extending it with my own ‘widgets’ , then I missed it. I can host RSS-generating code on my own server, but this detracts from pipes overall ease of use.

What do you think - will Yahoo Pipes become more than a toy to Java Developers?

Shashank Tiwari

AddThis Social Bookmark Button

The desktop transformed user experience through the last 20 years and has been the entry point for applications for a long time now. Come to think of it, even the browser is an application that resides in the desktops of users. The browser helps us access sites that run applications and that may be an aggregation itself, like a portal. The web applications, which traditionally were database centric and form, based data entry and reporting, email and ecommerce type applications are maturing into online office and collaboration applications (the offerings from Google), online gaming and online drawing applications (Gliffy). Interestingly enough though, the desktop has not changed fundamentally in its many years of existence and is still focused on file management, document creation and deletion, and local storage of documents type of functionality. Of course there has been the inclusion of web technologies into the desktops. More recently, Microsoft and Adobe (with its Adobe Apollo) may be examples of companies that are bringing the concepts and technologies of the web to the desktop. An important question then is, what is the future of the desktop and that of the web? Would the desktop be replaced by the web or would the web pervade throughout the desktop? These and related ideas were brought-up by David Temkin (www.davidtemkin.com), the co-founder and CTO of Laszlo Systems as a part of his presentation at the AjaxWorld in New York. David seemed very bullish about the web outperforming the desktop in being the center of user experience in the long run. Guess that is why, Laszlo is taking the desktop to the web with its Webtop offering and betting on it being a preferred solution going forward. Of course they are not the only ones doing it neither are they the first to do it. Laszlo Webtop is a solution that provides the infrastructure to build a web-desktop or a “webtop”. It leverages Java on the server side and is built to take advantage of the established server side java frameworks and mechanisms. (I tried the initial release of this product and maybe would talk about it sometime later or try and compare and contrast it with similar offerings from other vendors.)

Now we are not sure if the Laszlo Webtop is the winner in the long run and I am not trying to present David Temkin’s presentation verbatim here, but I think the questions he has raised and his opinion on the matter are indeed something for us to ponder about. Considering that java developers may still be struggling between old Apache Struts type web frameworks and the numerous hybrid choices that AJAX/RIA have presented to them, are they thinking about where the web-desktop convergence is going and the role they want to play in shaping this convergence’s destiny. Or is it that some of us are happy that such concepts could theoretically be partially or fully implemented as Applets even some 10 years back. Or is it that we are waiting for a JSR to be initiated for such a purpose :)

AddThis Social Bookmark Button

Starting from EJB 2.1, Timer Services are available for building J2EE Applications that depends on time based services. Time based services are mostly used in scheduling applications. Technically, these scheduling applications are called workflows. A workflow defines a configurable sequence of activities or tasks that will take place at a particular point of time. Before EJB 2.1, one has to manually code for building and deploying time-based workflow systems. But, with the invent of EJB 3.0, thanks to Annotations and Dependency injections, life has become still more easier for creating such applications.

EJB 3.0 Timer Services - An Overview

Robert Cooper

AddThis Social Bookmark Button

It is hard to miss the word in my RSS reader the last few days. The Genuitec modifications controversy continues to boil. The Sniping about what has been rechristenedRedHat Developer Studio is getting tiresome. But the trademark of Hibernate and the “some people say” seeming Bellevueian enforcement of such boils around the web.

On the more technical side, though, is Google’s Hibernate Shards distribution/balancing system and the Hibernate Search stuff rolling out. Hani notes some Hibernate JPA compliance bashing at TSSJS (marginally safe for work), something that I have run into a number of times.

Tim O

AddThis Social Bookmark Button

Here’s a quote from an email I received yesterday from a colleague who uses Lotus Domino very heavily. Domino is one of those tools that isn’t hip, there are no groundbreaking Web 2.0 sites written in Domino, and as far as other Lotus products are concerned, people tend to have a visceral negative reaction whenever someone mentions Lotus Notes as an email platform. Regardless of your reaction to Notes, this colleague does manage to consistently produce revenue generating applications on Domino. Yesterday he sent me the following:

[Domino] has evidently entered public beta testing. Below is a link to the new features outline:

http://www-128.ibm.com/developerworks/lotus/library/notes8-new/

Interestingly, it appears that the Notes Client and Designer (the user UI and the IDE respectively) have been rebuilt from scratch as Java extensions on Eclipse. I didn’t see that coming.

Even though Lotus Notes has a reputation for being a something as an anachronism, lauching the new Lotus Notes client on the Eclipse platform is a big deal for the Eclipse platform as a foundation for end-user applications. Just when you least expected it, someone decides to ship a large client-side Java application.

From the DeveloperWorks article written by David DeJean:

The big news in Lotus Notes V8 is that the Notes V8 client encapsulates all the code that is Lotus Notes within the Eclipse environment. This move puts Lotus Notes on an open-source Java-based platform. Originally created as an integrated application development environment, its open, plug-in-based architecture has made Eclipse itself the foundation for rich client platform development. Lotus Notes V8 is built on Lotus Expeditor, IBM’s universal managed-client software, which, in turn, is built on Eclipse.

Paul Browne

AddThis Social Bookmark Button

Lost in the hype around Service Orientated Architecture (SOA) is the fact that the idea is really really simple. It’s all based on the idea that most applications (and that includes websites) are built either to be used by people , or used by computers. The pictures below (a free preview from the Enterprise Java Briefing) show what I mean.

In a ‘normal’ application, such as a online banking website, we need to remember what the user did last (are they logged in, what account are they looking at, are they in the middle of making a payment). If we didn’t , the user would get annoyed about having to repeat themselves every step of the way. It would also make for pretty complicated screens, to allow the user to enter all the information in one go. Instead , we allow the user to enter information in several steps, and remember where there are each time.

Soa Client

In an application designed to be used by computers, we don’t have to worry about this. We can force the computer to give us all the information required all in one go - username , password, bank account to take money from , bank account to give money to, date to execute transaction. For a computer , this is actually easier ; we make one call to our banking service and we are told it has succeeded or failed. It’s also easier for us to build our service:

  • Each service (transfer money, book flight , execute share trade) only does one thing.
  • Because each service ‘forgets’ after each call, we don’t need to worry about trying to remember what we were doing before.
  • Because we have no memory, services are very scalable; we can make several copies of the same service and put them in a pool. Any client can talk to any service - no waiting for a particular server to become available.

Soa Service

So that’s Service Orientated Architecture (SOA) : programs that do one thing (a bit like a function call to a method) exposed that other computers can call. So what’s the big deal? Like all good ideas , a simple concept goes a long way.

Take a look at the picture below. It’s like a Visio diagram, but in fact it’s drawn by the Eclipse Based JBoss IDE. It shows a workflow for an online commerce store - pretty easy to understand. This example uses JBoss Java Business Process Managment (jBPM), but companies such Tibco, Cape clear and Oracle BPEL have similar products.

soa workflow

Here’s the clever bit; each of these steps is executed by one of the services that we talked about earlier. This means that if the business process changes (and it will), then all you have to do is re-arrange the diagram ; little or no coding changes should be required.

This abilility to mix , match, combine and remix services leads us to a lot of other good things (and we’re only scratching the surface here).

  • Because our services don’t have to run on the same machine, we can use SOA to create a distributed application. This is the concept behind the BPEL (Business PRocess Engineering Language)
  • Services tie well to Ajax and Web 2: Our Ajax web page or portlet can call as many services as it requires to get the job done (it’s one of the reasons Tibcom is sponsoring the open source DWR project)
  • We can call many services at once. If these this service calls are xml based ,or we send these calls as a message then we can filter, duplicate, pass and other distribute these calls as we set. These are the ideas behind Apache Synapse, Apache Servicemix and the Enterprise Service bus (ESB) in general.

What do you think? Is SOA useful , or over hyped?

Shashank Tiwari

AddThis Social Bookmark Button

AjaxWorld (www.ajaxworld.com) is still going on at the Roosevelt Hotel in New York City but one conclusion could be drawn pretty much from the start - most presentations and expositions, with the exception of Microsoft (and maybe a few others), are and were about how Java developers could leverage the multitude of Ajax, RIA or call it Web2.0 technologies out there. In fact, the java development community was perhaps the binding or common thread among the multiple and numerous offerings. Laszlo and Adobe of the extreme rich gui camp have explicitly been talking about leveraging server side java for a while and JSF vendors (with or without ajax) are ofcourse in the business of appealing to java developers but what was interesting is that even the Javascript focused ajax folks were talking java. As an example, James Harman, in his presentation - “Creating AJAX-Powered Forms with the Dojo Toolkit” explicitly mentioned how the Javascript libraries of the dojotoolkit where so java like in their structure and usage. Looks like a lot of people like Bruce Eckel are betting on the “Hybridizing Java” story, either as firm believers or “don’t want to miss the train” participants. What do you the readers, as Java developers and architects, think? Are you folks happy about all the zillions of options? Do you think it’s all unnecessary and Java itself could get most (if not all the) the job done? Do you think “AjaxWorld” should be renamed as “AjaxWorld for Java Developers”, since that’s where all the action is?

Dejan Bosanac

AddThis Social Bookmark Button

As you all have probably heard, Velocity 1.5 was released last week. It is the first release of this project in last three years. This is certainly a long release cycle and it is not unusual that some people considered it a “dead project”.

I have some projects that use Velocity as a template engine of choice and over the time I’ve collected a “wish list” of features that I missed. Due to lack of new releases, I’ve considered switching to other template engines, such as FreeMarker and WebMacro, but actually never found time to do that.

As I go through the release note, I see that some of the wish-list features have been added to this release. Some of them would be nice to be seen in the future (road map looks promising). Here are some details:

AddThis Social Bookmark Button

Mustang has few interesting changes in the Collections APIs, one amoung them is the Deque. Deque is used for the Bi-Directional traversal. It has different implementations including BlockingDeque,ArrayDeque,etc.

Deque and ArrayDeque

Deque is the abbreviation of “Double Ended Queue”. A Collection that allows us to add (or) remove elements at both ends. Deque supports total size of collection for both fixed and unspecified size limits.

Deque implementation can be used as Stack(Last in first out ) or Queue(First in First Out).For each insertion, retrieval and removal of elements from deque there exists methods in 2 flavours. One will throw exception if it fails in an operation and another one returns status or special value for each operation.

What is new in Java 6.0 Collections API?

Robert Cooper

AddThis Social Bookmark Button

The Java Posse Roundup was last week. It was pretty great. This was of the “Open Spaces” genre. Basically, everyone shows up, and scheduling of sessions is done in an impromptu and ongoing manner via stickies and blocks on the wall.

The one thing that I “got” as I walked in was that 2007 was the year the Java language and the Java platform completely bifurcated. GWT represents the Java language moving way out of the JVM. Indeed, GWT and Apollo represent some of the most exciting parts of Java the language right now. Of course, the discussions of dynamic languages and and Scala represent the JVM moving away from the language at a seeming breakneck pace.

Dick is going to filter out the session audio as he gets them prepared, but I specifically attended sessions on build systems, the “forges” (j.n, code.google, sf.net), Joe’s “Properties and Events in the Language” session, a session on Apollo, I hosted a session on GWT and help Josh present AB5k, a very interesting session on the possibilities of forked Javas, and a session about the future of desktop Java. I also got a chance to sit in on Java Posse 106.

It is really tough for me to put together a list of highlights, because the whole affair was really quite awesome. It was very much a nerd summer camp crossed with a revival meeting. Really, I highly recommend it next year for those of you who weren’t there.

I have more photos, including both the Jackalope and the Gronk.

AddThis Social Bookmark Button

Could the open source agile, lightweight Google Guice be the next Spring?

Robert Cooper

AddThis Social Bookmark Button

Josh held the premiere session for AB5k Tue at Java Posse Roundup (I will post a summary of the week soon). Since there is some discussion going on, including our getting panned at JavaLobby, I thought I would write up a little bit about how the desklet runner system works.

.desklet files are, simply, JAR files. Inside the META-INF folder you place a desklet.xml file that looks something like this:


<?xml version="1.0" encoding="UTF-8"?>
<desklet version="0.1">
    <name>ROME Reader</name>
    <author>Robert Cooper</author>
    <homepage>http://www.screaming-penguin.com</homepage>
    <description>An RSS/Atom Feed Reader</description>
    <class>com.totsp.desklet.rome.RomeDesklet</class>
    <repository>http://myserver/repo</repository>
    <dependency>
        <groupId>jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>8.0-20060801.131059-3</version>
    </dependency>
    <dependency>
        <groupId>rome</groupId>
        <artifactId>rome</artifactId>
        <version>0.9</version>
    </dependency>
    <dependency>
        <groupId>jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>FlyingSaucer</groupId>
        <artifactId>core-renderer</artifactId>
        <version>R6</version>
    </dependency>
    <dependency>
        <groupId>FlyingSaucer</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.4</version>
    </dependency>
</desklet>

Most of the stuff at the top is pretty straightforward. The big thing here is the dependency management. There are a number of ways you can specify deps for your desklet. The recommended way is to specify them in the desklet file, alternately specifying a repository in Maven 1 layout (M2 will be supported soon), and declare the dependencies in your desklet.xml file. When your desklet is installed the required dependencies will be downloaded and put into a shared repository. The reason this is the best tact is downloaded dependencies are put into a shared repository and are not re-downloaded for each desklet, improving the user experience, and reducing desklet size.

Another option is to place the dependencies in the META-INF/lib folder in a Maven 1 repository directory structure. That is, META-INF/lib/[groupId]/jars/[artifactId]-[version].jar. Jars packaged in this manner will take precedent over the local repository. This can be useful if you want to ensure for security or other reasons that the exact version of the Jar you want will be used with your desklet.

The final way you can package dependencies is to simply place Jars you need into the META-INF/lib folder directly. These jars will be in place for your desklet, but do not have to be declared in the desklet file. This is a convenience, and can be useful if you have Jars that are not deployed to a Maven repository. However, please keep in mind your desklet files can become large when you do this.

That is all for now. You can expect Josh to be posting information on the specifics of writing desklets this weekend. I will also post information about security and runtime of desklets later this weekend. Also, please keep in mind that between now and JavaOne a lot is expected to change.

AddThis Social Bookmark Button

On Monday, news broke from EclipseCon: Red Hat JBoss announces a partnership with Exadel. Eclipse based Exadel Studio is now open source and going into JBoss.org for continued development and merging with JBoss IDE, etc. This will be called Red Hat Developer Studio IDE platform.

Paul Browne

AddThis Social Bookmark Button

I been asked to spec an ‘Advanced Java’ training course. The list (below) contains a couple of ideas of what should be on such a course but ‘Advanced Java’ means different things to different people. Over the many years you’ve spent with Java, you’ve specialised - partly out of what interests you, and partly out of the work that’s been available.

So the question is: What do you think an Advanced Java training course should contain?.

I’ll narrow it down it bit - it’s got to be stuff that’s mainstream or almost mainstream (however much I’d like to cover JavaSpaces). It’s not dogmatic - i.e. it’s not the ‘Enterprise Java and nothing else’ that was common a couple of years back. But it does have to be of interest / of a level for people coding Java for 3 years or more , and who want to push their skills to the next level. (I also suspect that I’m going to learn as much from them on this course).

Just as important, why do you think [insert topic here] should be included on the course? Leave a comment.

Current Menu of Topics (Full Course description here)

(this list is an early draft , so I’m prepared for some glaring omissions!)

  • Aspect Orientated programming
  • Spring Framework
  • Hibernate
  • Ruby , JRuby and other scripting languages in the JVM
  • Java and .Net (C# , VB.net) interoperability
  • Struts 2 Web Toolkit
  • Agile Programming , Junit and Fitnesse
  • Java , Web and Ajax
  • Business Rules and Rule Engines
  • Workflow and Business Process Engineering Language (BPEL)
  • Search in Java Applications - using Google and Apache Lucene
  • Enterprise Service Bus
  • Service Orientated Architecture.
  • Eclipse Advanced features (also WSAD - IBM / JBoss IDE)
  • JDeveloper Advanced Features
  • JMS & Messaging
  • Introduction to Architecture and design patterns
  • JSF - Java Server Faces and Oracle ADF , Apache MyFaces
  • Apache Tomcat and Jboss
    Advanced Features.
  • Google Web Toolkit
  • Maintaining older systems
  • Refactoring
  • Agents
  • Web Services
  • What’s new in Java 5
  • What’s new in EJB 3
  • Key Java Open Source Projects
  • Server side Java for Mobile Solutions

What am I missing? What should I delete? Let me know.

Paul , Technology in Plain English

AddThis Social Bookmark Button

As reported by Inside Java earlier today, the NetBeans IDE platform announces support for Ruby/JRuby. It doesn’t come as a suprise as Sun backs both the open source NetBeans and JRuby projects.

Chris Adamson

AddThis Social Bookmark Button

Remember how I said I had proposed a JavaOne BoF on Java Media, but didn’t expect them to approve it?

Advertisement