Java EE 6 Features Overview
By Partho, Gaea News NetworkFriday, August 28, 2009
Java EE 6 arrives as a big leap transforming into an ideally simple, streamlined and well-integrated platform. Java Platform, Enterprise Edition (Java EE) has grown over the years since its in 1999. After years of development the Java EE platform has accumulated a chunk of outdated APIs that are not well supported or not widely deployed. Improving over the past two version, the Java EE 6 mainly focuses on providing ease of development and support for the third party frameworks.
The platform has undergone a significant upgrade with a new set of innovative features - brand new APIs like WebBeans 1.0 and JAX-RS 1.1 and servlet 3.0, clearly reflected in the technology. Additionally, some minor changes have been incurred such as standardizing global JNDI naming, the major themes for JSR 316 are pruning and profiles. Let’s have a broader view of the newly incorporated features in Java EE 6.0.
Profiles in Java EE 6.0
One of the most crucial additions to Java EE 6 environment is Profiles. It is mainly focused in reducing the size of environment when it is not required. Essentially however small the application may be it comes pre-loaded with the already existing technologies in the environment. Although a developer might not require to use all the technologies provided in an environment they have to deal with everything provided by the vendor. The Java EE expert group has introduced Profiles to overcome this issue.
The Profiles have been designed for a specific requirement or a particular solution. Suppose a developer needs only the JSF and JPA for a web project; in that case, they will be able to use a specific profile required for the web applications development. Currently, Java EE 6.0 specification only includes the Web Profiles. No other profiles have been defined yet. In future we could expect more profiles based on feedback from the community members.
Pruning in Java EE 6
In the previous versions, Java EE none of the features were completely removed from the specifications.Due to this the SDK has been overloaded with some outdated APIs that are not well supported nor widely deployed. This adversely affects the installation time.
Java EE 6 leads the process of carefully pruning these APIs to make the platform more lightweight and also make room for refinements. The pruning procedure will not be implemented immediately, as this might break up the sequence with past releases. The pruning would take place in several steps by declaring outdated features as option in the future releases. For now the two proposals for pruning are JAX-RPC and EJB CMP.
Servlets 3.0 in Java EE 6
New Servlet technology is one of the most significant changes in Java EE 6 that is the major focus by the community. Making the deployment descriptos optional the new version uses annotations to declare the servlets.
Besides using annotations, overall specifications are more focused on simplifying the web tier technologies. The inception of Servlets 3.0 makes it easier to add the third party libraries like Struts, Spring, JSF, etc, without any web.xml changes. Further, Servlets 3.0 offers a Web Fragments descriptor that would specify the details of each libraries used by the container. This is definitely an bonus for the web developers who had a hard time integrating the frameworks.
JPA 2.0 in Java EE 6
JPA 1.0 is one of the technology for the Java platform to develop more flexible and simplified database applications.
From the excerpts in JSR 317 we can make out that JPA 2.0 version may include the following features
Officially the JPA has been separated from the EJB as a separate API. JPA has been a huge success and enjoys first-class vendor support. JPA 2.0 seems to be filling in the gaps left by EJB 2.x Entity Beans and adding useful innovations. Let’s have an insight into its features
- Adds a number of ORM mapping enhancements such as the ability to model collections, maps and lists via @ElementCollection annotation. It also has the ability to map unidirectional one-to-many relationships.
- Improved EntityManager and Query APIs to support retrieval of the first results,access to the underlying vendor-specific entity manager/query objects, specifying the maximum size of queries results and pessimistic locking.
- Adds the much need Criteria API, the object-oriented, type-safe, Java-centric equivalent of JPQL statements. This would help in writing complex dynamic queries and avoiding runtime exceptions thrown while parsing JPQL.
- Enhanced JPQL with SQL-like CASE, NULLIF, COALESCE and similar capabilities.
In addition, JPA 2.0 has been filliped with a host of features that include standardizing second level caching, standard JDBC properties, specifying timeouts and the likes.
JSF 2.0 in Java EE 6
It features a lot of new developments to the web application. The changes have been classified under Ease of Development, Performance, Technology Adoption, New Features and Fixes. There would be a bunch of annotations to be used in JSF 2.0 avoiding the use of faces-config.xml and web.xml. Overtly, almost everything can be done with the annotations.
Several new features has been provided in the specs that include request processing lifecycle to be aware of Ajax, allow for bookmarkable JSF pages, and a mechanism to easily access persistent store.
Web Beans 1.0 in Java EE 6
In Java EE edition the persistance layers(EJB 3.0, JTA, JCA and JPA) and the presentation layers (Servlets, JSP and JSF) are segregated and feature no closed interaction. More precisely, there’s no conduit technology that would integrate both the persistance and web tier. This issue has been met up with the Web Beans 1.0 designed to be compatible with both the tiers. The Web Beans have been equipped with beans that could interact by multiple tiers. Web beans is influenced by the popular frameworks JBoss Seam and Google Guice.
Additional features in Java EE 6
Here’s a list of minor changes in the technology
- JSR-237 Work Manager for Application Servers
- JSR-236 Timer for Application Servers
- JSR-196 Java Authentication SPI for Containers
- JSR-299 Web Beans
- JSR-311 JAX-RS: Java API for RESTful Web Services
Overall its a commendable piece of work from the expert group. To some extent they have been successful in transforming Java EE into a powerful platform that would be a amiable piece for web developers. Apart from these the innovations in the APIs that make up Java EE 6, and the changes proposed by the JSR 316 expert group is worth an accolade.
Tags: Ejb, Java EE 6, Java EE 6.0, Java Enterprise Edition, JSP, Servlet, Servlets, Web application
UJEE