|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP THREE LINKS YOU MUST CLICK ON The Simplicity of EJB 3.0
A step in the right direction
By: Raghu R. Kodali
Aug. 10, 2005 11:00 AM
Digg This!
Page 2 of 2
« previous page
The EJB 3.0 RosterApp didn't require the existing DTO baggage, but I had to make sure that the Team, League, and Player POJOs implemented java.io.Serializable. I also had to get rid of extra methods such as getPlayersofTeamCopy() in the Session facade of the EJB 2.1 RosterApp, which were doing the grunt work of managing data between DTOs and entity beans. On top of eliminating the extra overhead, I had to simplify the business methods in the Session façade of the EJB 3.0 RosterApp, as they were using DTOs all over the place. Listing 3 shows the sample migrated code.
Migrating the Session Beans
Migrating the Client
Comparing EJB 2.1 to EJB 3.0 I used the numlines (www.gammadyne.com/cmdline.htm) utility, which gives the line count for uncommented and non-blank lines - the only types of lines added for the old and new applications. In the EJB 2.1 application, XML files were counted based on the deployment steps recommended in the J2EE 1.4 tutorial (see Table 2).
Conclusion There are other neat features in EJB 3.0, such as the ability to use database sequences; I used this for one of the POJOs, but backed out the changes to make the existing and new applications more similar. There doesn't seem to be support for native SQL queries, though the specification claims there is. I would have loved to use those queries instead of EJBQL, as database portability wasn't an issue for this exercise. While the specification is a step in the right direction, I'd like to see more tool/IDE support for EJB 3.0 so that more Java application developers can get up to speed on it. While any standard IDE with decent support for Java SE 5.0 will be a good start, I'd like to see better tooling to support complex mappings (such as many-to-many), and to facilitate inline or immediate feedback on the validity of NamedQueries instead of waiting for deployment. Maintaining applications can't be ignored, as applications will live for few years after the development cycle. All the features that make application development easier will also provide returns in the application maintenance cycle. I recommend that developers take a fresh and unbiased look at the EJB 3.0 specification by checking out its features and giving the publicly available EJB 3.0 containers a spin. (Oracle Application Server EJB 3.0 Preview was used for this exercise.) References
Page 2 of 2 « previous page
LATEST JAVA STORIES & POSTS
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK SPONSORED BY INFRAGISTICS
BREAKING JAVA NEWS
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||