X
Business

JavaOne: Java EE 5 and beyond

Java EE 5 is done, and vendors and IDEs are getting behind it. JEE5's goal is to make it easier to develop JEE applications, especially when first getting started. Bill Shannon gave us a status report at JavaOne today.
Written by Ed Burnette, Contributor

During the Sun general technical session today at JavaOne, Bill Shannon gave the attendees a status report on Java EE 5.
Bill: Java EE 5 is done, yeah!

Vendors and IDEs are getting behind it. JEE5's goal is to make it easier to develop JEE applications, especially when first getting started. To do that we moved to a declarative programming style with annotations, moved to a POJO programming style, reasonable default behaviors, and introduced some new powerful frameworks.
We've made extensive use of annotations to define and use web services, map classes to XML, simplify EJB, map classes to databases, specify external dependencies, and more. JEE5's major features include simplified web services support, more web service standards, dependency injection, greatly simplified EJB development, new Java persistence API, and easy web applications with JSF. All of this was done while remaining compatible with J2EE 1.4.
Demo: Using NetBeans 5.5 to add a web service. Right click on project, select New > Web Service...
Web Services in Java EE 5

  • built on JAX-WS (follow-on to JAX-RPC) and JAXB
  • supports latest W3C standards and latest WS-I standards
  • starting to support WS-* specs like WS-Security, with more to come.


JAXB 2.0
JAXB 2.0 binds Java classes to XML schema. It has 100% XML Schema support, uses a portable annotation driven architecture, provides the data binding layer for JAX-WS.
JAXB 1.0 generated 308 lines in 38 files, 219KB of code total for a simple schema of a Point class.
JAXB 2.0 generates 62 lines in 2 files, 3KB of code.
EJB 3.0
EJB was also greatly simplified in JEE 5. It's a dramatic simplification of all bean types, POJO based, more defaults, dependency injection, and interceptors.
Demo: Creating a transactional web service with the "Vi" IDE.
Java Persistence API
The Java Persistence API is a single persistence API for Java EE and Java SE. It was developed by the EJB expert group. It's much simpler than EJB CMP, and there are at least three implementations already (all open source).
Demo: Using NetBeans with Persistence and data tools.
Dependency Injection
Dependency Injection is an example of Inversion of Control. The container injects resources like DataSources, EJB references, web service references, etc. into applications as fields or methods. This removes the need to use JNDI in most cases.
JavaServer Faces (JSF)

JSF 1.2 is the standard web application framework for JEE. It does dependency injection in managed beans. It includes an extensible expression language shared with JSP. There's a large market of JSP components, over 200 from 20 vendors including Ajax support.
In addition to making it easier to write the code, it's much simpler to package the application for deployment. In many cases you don't need a deployment descriptor at all.
How much easier is it?
Adventure Builder example: in J2EE 1.4 took 67 classes, 3284 lines of code. In JEE5 it took 43 classes, 2777 lines of code.
RosterApp example: In J2EE 1.4 took 17 classes, 987 lines of code, JEE5 took 7 classes, 716 lines of code. Plus the XML code was drastically cut. In J2EE 1.4 this example took 9 files 782 lines, JEE5 1 file 5 lines
Java EE Futures
We need your feedback to guide us on what is most important to do first:

  • Grow upwards (composite applications, portlets, high availability, clustering, etc.)
  • Grow downwards (Scripting, JavaScript in JSP pages, Web/app hosting, WebDAV, etc.)
  • Grow sideways (improve existing APIs, Ajax, WS-*)


Editorial standards