Though its release was largely overshadowed by the demise of its parent company, Java EE 6 is still here and is still offering compelling advantages for developers. From the new REST API to the slimmed down Web Profile, Java EE 6 takes a head-on approach to its classic problems of bloat and Web difficulties.
With EE 6, Java Server Faces (JSF), JAX-RS and the revised servlet specifications all combine to bring an easier path to Web applications for Java developers. Even more exciting for those developers is the Web Profile form of Java EE 6, a smaller form of the EE platform with most non-Web methods, libraries and dependencies removed.
Those new features for the language and its ecosystem are just part of the EE 6 release, however. Sun also released NetBeans 6.8 and the GlassFish Enterprise Application Server version 3 back in December. GlassFish has proven to be the star of the new platform, with over 20 million downloads since release. It is also a part of the Web Profile, giving developers a cutting-edge application server for their Web environments.
The Web Profile was built in response to developer complaints that Java EE was becoming too large to easily manage. Java EE 6 adds the concept of Profiles, which will be targeted installations for specific purposes. Initially, only the Web Profile is available, but Sun has said it is looking into more configurations. The Web Profile version of Java EE 6 installs only the pieces of the language and ecosystem needed to run Web applications, such as JavaServer Faces, Java Persistence API and other Web-related technologies.
GlassFish, too, can be slimmed down for specific Web purposes. Both the Java EE 6 environment and the GlassFish application server can then be upgraded to the full Java EE 6 stack without the need to change or update applications, said Tom Kincaid, former executive director of Sun’s Application Platform organization.
JSR 330 was a last-minute addition to the Java EE 6 specification, but it was a major change to the way Java works in a live environment. JSR 330 is a specification for dependency injections in Java originated at Google. JSR 330 came together and was passed through the JCP last fall, a break-neck pace for the JCP to approve a new specification. From the specification page at the JCP website, JSR 330 created “a set of annotations for use on injectable classes,” and “a type-safe, user-friendly injector configuration API that provides an integration point for higher-level dependency injection configuration approaches.”
Enterprise JavaBeans (EJB) also got a revision in the Java EE 6 platform. Version 3.1, said Roberto Chinnici, senior engineer at Oracle and Sun, rounds out JavaBeans with more complete capabilities. “I think the feedback we got on EJB 3, when people actually got their hands on it and wrote programs with it, was very positive,” he said.
“I think there were areas where EJB 3 didn’t do 100% of the work, and 3.1 is adding to that. You can now have a single EJB component, which is unique across an entire server. It’s a common design pattern people use in the Java language. There was no way to express that in EJB 3.”
All of those new features are nearly supported in the JBoss application server. Caucho’s Resin application servers will soon support the Java EE 6 Web Profile. But what is it like to develop with EE 6 in an enterprise?
Reint Jan Holterman, vice president of product Marketing at XebiaLabs, said, “What we see is that from Java 5 to Java 6, a lot of the low-level complexities were removed or solved in the Java spec. This trend is also visible in today’s OSS communities that center around Java EE, where developers continue to add software tools that make life easier for themselves and, therefore, increase productivity. The ultimate goal is to have smarter, faster, simpler code development.”
Ashesh Badani, senior director of JBoss middleware products at Red Hat, said that EE 6 is a vast improvement over EE 5. “Everyone has different opinions of the value of the various components. We got support for REST. We got EJB 3.1, a new servlet specification and support for annotations. There’s been a lot of moving forward in EE 6,” he said.
Adam Bien, author of “Real World Java EE Patterns: Rethinking Best Practices” and a member of the expert committee for the Java EE 6 specification, said that Java EE 6’s components fix many of the historic problems of Java EE.
“The complexity and bloat often associated with Java EE are largely due to the inherent complexity of distributed computing; otherwise, the platform is surprisingly simple,” he wrote in an article about Java EE 6 best practices.
“Enterprise JavaBeans 3.1 actually consists of annotated classes and interfaces that are even leaner than classic POJOs. It would be hard to find anything more to simplify. Nonetheless, (mis)use of Java EE can lead to bloated and overstated architectures.
“Now, though, EJB technology is lean and sound. EJBs are lighter—even weightless. They no longer require XML configuration, deployment of additional frameworks, or JARs. They integrate well with the Java Persistence API; scale well on multicore, multi-CPU machines; and are in fact the only vendor-neutral and portable solution for enterprise server-side applications.”
EJBs, said Bien, have come a long way, as has the Java EE platform. Though there were initial misgivings about EJBs and the scattershot manner in which they were maintained, Java EE 6 cleans up the mess made by previous versions of the Beans specification, he said. He claims that the new specification, when combined with other aspects of Java EE 6, can yield powerful benefits for the developer.