This article presents what is new in the Java EE 6.0 edition. There is lot of new activities in the JCP expert groups to add more valuable features in Java EE 6.0 version. Roberto Chinnici and Bill Shannon are Spec Leads for the JSR 316. For the past two releases of Java EE versions, sun is focusing on making the environment more easier for the developers instead of adding more new technologies.
For example, EJB 2.x is more difficult for the developers particularly the Entity Beans part in the EJB, then it has simplified the EJB 3.0 programming model in Java EE 5.0 by extensive use of annotations and introduced JPA 1.0 to reduce the complexitiy on persistance layer. The same approach continues in the Java EE 6.0 version also, they define it in the two topics namingly Extensibility and Profiles. Writing about all the changes in one article would become lengthy, so we will see some of the notable changes in this article like Profiles, Modularity and focus on Web tier.
2.New Features in JEE 6.0
Before looking into the details of the features, lets list what are the new things to be added in the Java EE 6.0. This section will list only the outline of the features with few lines of explanations. As we have already stated, the main goal of this release is ease of development and provide support for the third party frameworks. The new things in 6.0 is, adding new capabilities like Profiles, improving the technology like using annotations instead of XML in most of the technologies(Servlets 3.0, JPA 2.0) and removing the features (EJB’s CMP) which is not widely used by the developers. As rod Lets jump into the features list:
One of the major release in the Java EE 6.0 is the new version on Servlet technology which is given more attention by the community. The new version uses annotations to declare the servlets and making the deployment descriptos optional. Apart from using the annotations, as a whole the specification more focued on simplifying the web tier technologies. From Servlets 3.0 it is not required to changed web.xml for adding the third party libraries like Struts, Spring, JSF, etc. Servlets 3.0 introdues Web Fragments descriptor to specify the details of each libraries which is used by the container. This is one of welcome feature to the web developers since most of them finding hard to integrate the frameworks. There is more detailed article on New Features in Servlets 3.0 written by Christy. This article will give you more insight on the features. Please read on.
2.2.Web Beans 1.0
The problem with the Java EE edition is, the presentation layers(Servlets, JSP and JSF) and persistance layers(EJB 3.0, JTA, JCA and JPA) are grown seperatly without much closer interactions. There is no common technology to integrate the both web tier and the persistance tier. Web Beans main goal is to address this issue by defining beans which can be interacted by multiple tiers. Web Beans will be compatiable with technologies in the both tiers. Web Beans is influenced by the popular frameworks Google Guice and JBoss Seam. There is more detailed article on Web Beans and its Features.
Java Persistance API (JPA 1.0) is released in with the Java EE 5.0 edition on May 2006. JPA is one of the crucial technology for the Java platform to develope more flexible and simplified database applications. In the earlier days EJB CMP considered as more complex to develope database applications. So, sun has introdued JPA 1.0 with EJB 3.0 technology.
An excerpt from the JSR 317 says “including additional object/relational mapping functionality and query language capabilities, a criteria-based query API, and standardization of features currently designated as optional, and to align it with related JSRs that are currently in-process and/on in-plan for the Java EE 6 timeframe.”. The following are the features may be included in the JPA 2.0 version:
- Expanded object/relational mapping functionality, including greater flexibility in combining existing mapping options, support for collections of embedded objects, multiple levels of embedded objects, ordered lists, combinations of access types, etc.
- Additions to the Java Persistence query language
- An API for “criteria” queries
- Standardization of sets of “hints” for query configuration and for entity manager configuration
- Standardization of additional metadata to support DDL generation and “Java2DB” mapping
- Expanded pluggability contracts to support efficient passivation and replication of extended persistence contexts in Java EE environments
- Standardization of additional contracts for entity detachment and merge, and persistence context management
- Support for validation
JSF 2.0 promises to ring lot of new developments to the web application. They classify the changes in this release as Ease of Development, New Features and Fixes, Performance, Technology Adoption. There will be bunch of annotations to be used in the JSF 2.0 and try to avoid use of faces-config.xml and web.xml. Everything can be done through annotations how Servlets 3.0 has done.
The specification provides lots of new features like expand the request processing life cycle to be aware of Ajax, allow for bookmark able JSF pages, provide a mechanism to easily access persistent store.
2.5.Other Features in Java EE 6.0
The mentioned features are the major changes in the new release. Apart from these major changes, there is lot of small changes in the technology. Look into the list of new JSR’s:
- JSR-196 Java Authentication SPI for Containers
- JSR-236 Timer for Application Servers
- JSR-237 Work Manager for Application Servers
- JSR-299 Web Beans
- JSR-311 JAX-RS: Java API for RESTful Web Services
In the next section I explain about the another new features Profiles and how to pruning the features in Java EE specifications.
3.Profiles in Java EE 6.0
Profiles feature is major new feature in the Java EE 6.0 environment. It brought lot of controversies on its addition to the Java EE. The main goal of the Profiles is to reduce the size of the environment when it is not required. In the existing environment, what ever the small applications you are going to write about, it will come with all the pre existing technologies in the environment. The developer may not intend to use all the technologies provided by the vendor even though he has to adhere everything in one shot. To avoid this situation, Java EE expert group come up with Profiles.
Profiles are designed for a particular solution or a specific requirement. For example, you are developing a web project where you are required to use only JSF and JPA. In this case adding all the capabilities not needed and its more expensive. In this case you can use specific profile which suits for the web applications development. This is the basic idea behind designing Profiles into Java EE. As of now Java EE 6.0 specification includes only Web Profiles and there is no other profiles defined either. In the future version we can expect more profiles based on the feedback from the community members.
In the initial Java EE 6.0, there will be only Web Profiles added to the platform. Still the technologies to be used for the Web Profiles are not decided. The discussion is under way to make the conclusion. Roberto Chinnici, the spech lead for Java EE 6.0 blogged about the possible two options for the Web Profiles. He categorised it as the profile A and profile B.
The below table lists all the technologies in both the profiles:
Still the technologies are not finalized by the committee. This feature itself brought lots of discussions on the blogs about its pros and cons. Those who are against this features argues that giving extra on the server doesn’t harm the developer, also providing many profiles will confuse the developers to choose the right profiles for their applications and also it will end up in compatibility issues if they could not choose the correct profiles. We have to wait and see the implementation for the Web Profiles.
4.Pruning the Features
In the past releases, none of the features has been completely removed from the specification. This become drawback for the SDK in terms of size and the installation time. So, the experts comitee decided to remove the features from the specification if the
feature is not widely used by the developers or any alternatives available for the same feature. Here the removal may not happen
immediately since it might break the past releases. The removal process will go through several steps before it is completely removed.
It is performed in the multistep process where a feature is declared in one release may be moved as optional component in the next release. The JSR has few proposals for initial pruning of features. The two suggested proposals are JAX-RPC and EJB CMP.Here JAX-RPC is replaced by the JAX-WS and EJB CMP is replaced by JPA with more simplified manner.
In this article I have explained what are the new features in Java EE 6.0. This is only the introduction article and there is lot of changes are coming in Java EE 6.0 version. keep watching the section, we will publish more articles on the different topics. The notable changes in the Java EE 6.0 version is Servlets 3.0, Web Beans 1.0 and the Profiles. Apart from these three improvements, lot of small changes in the new version.