Search:
|
Access:
» Java EE 5, or It's Easier Now to Be a ProgrammerRelated categories: Java | Programming Tools | Object-oriented Technics | IDE | Programming in generall Arkadiusz RosińskiViewed: 4833 | Article date: 2006-05-11 15:22:51 Java 2 Enterprise Edition (J2EE) is a popular environment for developing enterprise-level applications. We are expecting a release of the specification of the new version of the platform in the first quarter of 2006; it is to be called Java Platform Enterprise Edition 5. In this article Arkadiusz presents solutions implemented in the new version.
Java 2 Enterprise Edition, J2EE in short, is a popular environment for developing enterprise-level applications. We are expecting a release of the specification of the new version of the platform in the first quarter of 2006; it is to be called Java Platform Enterprise Edition 5, Java EE 5 in short. About the authorArkadiusz Rosiński is an alumnus of the Military University of Technology in Warsaw, presently an employee of JAVART. He's had over three years of experience developing J2EE-based solutions. Possesses the certificates: SCJP, SCWCD. Contact with the author: arek.rosinski@javart.com.pl According to statements made by representatives of Sun, which supervises development of the new specification, solutions it is to contain will greatly speed up and simplify the process of building applications based on Java EE 5 while maintaining the plethora of features this technology offers. Materials published so far indicate that the greatest changes will be made in the realm of the EJB technology, including for instance a complete rewrite of the object persistence mechanism. Despite indisputable advantages of this API, in its previous versions using certain types of such components was invariably associated with serious problems and complications. Moreover, the Java EE 5 specification is to include a number of technologies which haven't been a part of J2EE yet, but have been available for programmers; this mainly refers to enhancements made to the Web Services toolkit and the Web UI toolkit. In the present article we would like to present the primary features of the new platform, as described by the Public Review version of its specification.
Figure 1. Architecture of the Java EE 5 platform The new version of the Java EE platform is based on Java 5.0. Thanks to which the former makes use of many new features of the latter, of annotations for instance, with the Commons Annotation API having been incorporated into the new J2EE specification. The Web Services toolkit has been extended with libraries: JAX-WS, WS-Metadata and StAX. JAX-WS enhances the functionality of JAX-RPC with capability of making direct use of the JAXB library which enables switching from a XML document to its Java-class representation and vice versa, implementation of new protocol specifications: SOAP 1.2 and WSDL 1.2, support for asynchronous RPC and Web Services using protocols other than HTTP, many convenience features for programmers developing Web Services. WS-Metadata standardises all documents necessary to define an application using this method of data publishing, among them: WSDL, WS-Policy and XML-Schema. StAX on the other hand is an implementation of a bi-directional streamed processing of XML documents, used more and more frequently in Web Services. One of the features of the new J2EE is incorporation of a framework used in developing Web user interfaces, JSF (JavaServer Faces), and a library containing standard JSP tags - JSTL (JSP Standard Tag Library). In a way, it is a response to complaints made about previous versions of the specification which didn't define a recommended method of developing the presentation layer. On the other hand, the servlet API has not been changed from the previous version; apparently architects of the new platform have decided that incorporation of JSF into Java EE 5 is a step far enough ahead. Looking at the EJB container one should take note that its object persistence mechanism has been isolated into its own API, the specification of which is called Java Persistence. Main Features of Java EE 5The primary goal of the developers of the new specification has been to preserve the wide range of capabilities offered by J2EE while simultaneously simplifying the process of developing applications and systems using this technology. Since one of the most frequently-used and at the same time most criticised specification of the J2EE platform has been EJB, in Java EE 5 it has been redesigned from scratch in order to meet the aforementioned conditions an eliminate the shortcomings of its predecessors. Listing 1. A class example of an Entity-type component with defined relations
import javax.persistence.*; One of the main hindrances of previous versions of EJB was the necessity of writing application descriptors. Although many tools and IDEs had appeared which did it automatically, having to place information pertaining with how an application was to run reduced the transparency of its code. In the new version of Java EE 5 the problem has been solved by using annotations - a feature of Java 5.0 which makes it possible to place additional metadata, to be used at various stages of application life cycle, directly in its code. Thus it is possible to place directly in the code information which used to be stored in descriptors. Despite making use of annotations it is still possible to use descriptors, in a slightly modified form though. Another issue which made the programmer's life difficult in previous versions of EJB was a relatively large number of specialist interfaces which then determined the way of using and the life cycle of objects implementing them, e.g. EJBHome, EJBObject. This inconvenience has been resolved by using POJO (Plain Old Java Object), or JavaBeans if need be, with all information previously specified by using appropriate interfaces being defined as annotations. This properly allows the programmer to operate on plain Java classes, assigning them appropriate features simply by defining appropriate annotations directly in the code, in the scope of the whole class, a single method or a member. Another convenient feature for application developers is to be the Resource Injection pattern, sometimes referred to as Inversion of Control.
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.






SDJ Users:
Shopping Cart









