QA#9: Java EE 6: XML-less, annotated POJO, light app servers, EJB-in-a-WAR - by Yakov Fain

This Q&A session is part of the community feedback on Java EE 6. So far the highlighted benefits are:

  • QA#1 - Standards compliance, vendor independence, milliseconds and kilobyte deployment.
  • QA#2 - Higher integrated specifications, simple and annotation driven, single-classloader WARs. Next level of industry standard
  • QA#3 - Jigsaw puzzle, Modular, standard, less xml, easy, easy, have I said easy?
  • QA#4 - Developers can concentrate on business logic, JavaEE6 is providing a standard for the infrastructure.
  • QA#5 - Faster development, less frameworks, less complexity, more great code shipped.
  • QA#6: Not your fat grandfather's enterprise Java anymore, enterprise Java renaissance
  • QA#7: Scripting framework like productivity based on standards
  • QA#8: Definite excuse to avoid Spring forever
This entry comes from Yakov Fain who works as Managing Director at Farata Systems, a company that provides consulting services in the field of development of enterprise rich Internet applications. He authored several technical books, and dozens of articles on software development.  Sun Microsystems has nominated and awarded Mr. Fain with the title of Java Champion. He leads the Princeton Java Users Group. His newest book "Java Programming. 24-hour Trainer" tutorial has been published by Wiley in February of 2011.



Here is a short summary of Java EE 6 from him:

Java EE 6 is XML-less, everything is an annotated POJO, almost no required interfaces, app servers are light, can deploy EJB in a WAR.

Keep reading for the fun stuff ...

1. How are you using Java EE 6 today ? What limits your adoption ?

I’m using Java EE 6 since Summer of 2010. I work for Farata Systems, where we develop Rich Internet Applications (RIA), where all server side code is written in Java EE. In the past, we’d often limit the use of the platform by picking a servlet container plus some third-party frameworks. But now we can use the Web profile subset of Java EE 6. 

The reputation of the older versions of J2EE has been damaged by over-engineered EJBs, tons of XML, and complicated deployment  process. Things dramatically changed now, and several major application servers already support (fully or partially) Java EE specs.  GlassFish evangelists do an excellent job in getting the word out about the latest features of GlassFish. It would be nice to see more materials showing the latest JBoss, WebLogic, and WebSphere developments in the Java EE 6 area.



2. What Java EE 6 technologies are you using and why ?

I like the latest servlets for not being thread-hungry, the JMS API for being simple and asynchronous, and EJB 3.1 – for being no-xml-annotated-POJOs-in-a-war.  I like the ease of creating a singleton bean that can be started on the server startup and schedule a process, say to push the price quotes into some message queue without the need to configure a cron job. 


3. What is your development and deployment environment ?

Typically, we develop the front-end of RIA using Adobe Flex. Usually we work in Eclipse for Java EE IDE with installed Flash Builder plugin. We start the servlet container or application server - Tomcat, Jetty, or GlassFish 3 -  right from the IDE. (there is an Eclipse plugin for GlassFish too). We’ve also created and open sourced a tool called Clear Toolkit that uses annotated Java and XSLT to generate a complete CRUD application (integrated with Spring and Hibernate) in minutes. The build script generates a WAR file that can be deployed in any Java EE servlet container.


4. What previous versions of Java EE / J2EE have you used ? How has the migration to Java EE 6 benefited ?

I’ve been using J2EE since the year 2000. Back then I’ve been working on equity trading platform for a major brokerage house. The system has been based on EJB and JMS.  After that, I’ve completed a number of projects where EJB’s were out of the picture - they required heavy application containers and writing too much of the boilerplate code. The situation has changed dramatically with the release of Java EE 6.  The session bean EJB 3.1 is one class - a POJO that doesn’t even require any XML configuration.  Entity beans are gone – just use the JPA 2.0 API for persistence.


5. Describe the benefits of Java EE 6 to you in 120 characters.

Java EE 6 is XML-less, everything is an annotated POJO, almost no required interfaces, app servers are light, can deploy EJB in a WAR.


6. Advice for anybody who is looking at Java EE 6 for their next project ?

During the last years the words Tomcat and “light-weight container” were casually used together. Think out of the box. Give GlassFish 3 a try and you may be pleasantly surprised. The Eclipse/GlassFish combination is a very easily configured development environment. GlassFish starts faster than Tomcat, it has good Web-based admin tool, no need to install additional software (e.g. JOLT) to support transactions. I remember going through the pain of configuring Apache Tomcat with another open source message-oriented middleware, while GlassFish comes integrated with OpenMQ and mapping JMS and MOM queues is really easy via GlassFish admin console. Overall working GlassFish 3 just feels better than Tomcat 6, which was not the case when I tried using GlassFish 2 a couple of years ago.


7. What new features you'd like to see in Java EE 7 ?

I don't have problems with the server side APIs, but I’d like the Java EE 7 to standardize on the deployment of the client portion of the Java code that has to communicate with the server. For example, recently I wrote a Java applet that had to use JNDI to locate some server-side objects deployed in GlassFish 3.  Such a simple task brought me to a dead end as there is no standard and light-weight set of classes to be packaged with an applet that would allow me to create a Java client that uses JNDI.

Several people suggested me to use REST instead of JNDI. But why? Is JNDI API a candidate for pruning?  In general, I’d like the future versions of Java EE to remember that there can be a Java client running remotely, which has to be light-weight and be able to communicate with server-side containers via fast communication protocols. 

To summarize this Q&A, I do encourage enterprise architects – people who set the trends – to take a closer look at Java EE 6 and speed up its adoption in your organization.

Thank you Yakov for taking time to prepare the answers!

Are you developing, deploying, consulting, training, authoring books, etc in Java EE 6 and would like to express your opinion in a similar format ? Drop acomment on this blog and I'll line you up for the Q&A session :-)

The Java EE 6 hub is your key resource to learn all about the technology.

And you can always try all Java EE 6 features in GlassFish and refer to an extensive set of Java EE 6 & GlassFish demos.

Also check out our youtube channel and follow us on @glassfish.

Technorati: javaee6 community feedback yakovfain glassfish v3

Comments:

Do you know of any way to use jolt to talk to Tuxedo servers under glassfish? We're thinking of migrating one of our projects from Weblogic to Glassfish but we have a lot of Tuxedo backend so it feels like we're stuck with Weblogic.

Thanks.

Posted by Oded Shopen on December 12, 2011 at 03:31 AM PST #

Oden,

Seems like there are instructions available for it at:

http://docs.oracle.com/cd/E19575-01/821-0030/gheqx/index.html

You can also try posting a question to GlassFish Forum:

http://www.java.net/forums/glassfish/glassfish

Posted by guest on December 12, 2011 at 09:15 AM PST #

Post a Comment:
Comments are closed for this entry.
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today