Java EE (JEE) has changed its face entirely from the past. The new look of JEE is exciting and simpler. With the rise of Web 2.0 and usage of simpler and lighter mechanisms for enterprise application, JEE has come a long way, to provide the latest and the best features in the market. For the new beginner in the world of Java EE it becomes essential to know the new and exciting things which JEE provides. This article makes a brief attempt to bring forth the facts which currently ride the waves in JEE with some comparison with the earlier counterparts.
The Musketeers of Java EE
If you know Java and want to sprint in the world of Java EE (JEE), you have to face a lot of hurdles in wanting to know which kind of technologies you have learn. If you look at the most used technologies which form a standard part the JEE are:
- Servlets , Java Server Pages (JSP)
- JSF – Java Server Faces
- Enterprise Java Beans (EJB)
- Web Services
- JDBC, JCA and others.
JSP / Servlet Technology and Its Current State.
Servlets were the first of the architecture which came into picture for the JEE world. But the Servlet Model was not acceptable besides processing some common application logic. It became very tedious to implement HTML output in the Servlets so JSP was introduced to make the coupling between presentation and application logic separate. JSP was used to implement web page design alongwith adding scripting features for conditional output. The new Servlet 3.0 specification is round the corners which might cause a revolution for the acceptance of Servlets in their core form once again.
Due to advent of design patterns it became inevitable that using servlets to apply application logic and using conditional processing in JSP’s was considered to be a bad programming practice. Servlets then were resorted to being used as controllers in MVC (Model View Controller) applications.
To give a boost to the growth of JSP and servlets several API’s and in built features were released such as the JSTL (JSP Tag Library), Expression Language and Standard actions. These API’s made an impetus to the usage of JSP as the templating language. But at that time several other custom implementation were also present such as the massive Struts framework which incorporated all the above features.
Presentation Tier and the Frameworks
Struts 1.0 became one of the largest used MVC frameworks due to its robust features and support from major vendors. Till now Struts has faced many highs and lows The new release Struts 2.x makes a huge leap over the traditional architecture of Struts 1.x which was many a times criticized, by now uniting it with WebWork 2.0, making it even more simpler than its earlier versions.
JSF came into the picture when there was a rising need to standardize the presentation tier framework. Frameworks such as Struts and Spring MVC have been accepted by enterprises lately for implementation of the presentation tier. Many big vendors provide support Struts but still it isn’t a standard.
In order to make a standardized approach for the web tier JSF was released. JSF is a presentation tier technology which implements a component form of rendering of the output. It makes no assumption on what might be the consumer of the application and thus provides an abstract way of implementing the view components which carry the output.
JSF provides a render kit which takes the given output and formats it according to the consumer which may be a browser, a mobile device or a swing application. The flip side of JSF is that is does not provide in built support for Ajax which is largely required for a Web 2.0 application.
Business Tier and the Fall of EJB 2.x
EJB was implemented due to the need of transactions and decoupling of business logic from the presentation and controller tier. EJB handled the business logic and the data through the way of beans. Session beans and Message Driven Beans were meant to hold the business logic which Entity Beans were used for transfer of data and persistence. The complexities involved in EJB even for a simple application was huge which demanded heavy utilization of resources and complex implementations terminologies. The overuse of XML for configuration of the beans was too much for a developer.
When Spring framework came into the picture, it brought in picture the power of Inversion of control (IOC) and Dependency Injection (DI). These concepts started to gain momentum due to the advantages such as light weight containers and out of the container testability of the individual components in the application.
The main factor in the growing usage of Spring was the maximum utilization of tasks via POJO‘s and using configurable services to them and Aspect Oriented Programming (AOP). The success of Spring lead to a downfall in the usage of EJB and other alternatives were also chosen in place of EJB 2.x. The major usage as an alternative for EJB came in the form of Hibernate , Struts and Spring frameworks.
- Struts – For implementing MVC
- Spring – For the business tier
- Hibernate – For ORM (object relational mapping) and persistence.
Now these concepts have been accepted in the EJB specification by the Java Commiunity Processs (JCP) which now had been released as the EJB 3.0 specification as a part Java EE 5 edition.
EJB 3.0 which some people term as a combination of Spring and Hibernate makes use of the concepts of DI and IOC. The most lovable feature of EJB 3.0 is the use of Java annotations which were introduced in Java 5. The use of annotations completely avoids the use of XML for configuration. EJB 3.0 specification does not include the Entity Beans of EJB 2.x which were the cause of heavy utilization of resources.
EJB 3.0 makes use of Java Persistence API (JPA) which can even run outside the EJB container and can be used for a Java SE application. JPA provides the much needed features like ORM and persistence. EJB beans are now POJO’s and the services of the container are injected in the POJO’s by annotations. This makes development easy without the need of a container and good for the testing purpose.
SOA is being constantly labeled as the next generation breed of applications. Its implementations may not have touched the realms of great accomplishments but the work done in its favor should be appreciated the most. You can the see the hoard of specifications that the Java EE community has bestowed on its followers.
Web services are the current gateway for SOA and the Java EE community has provided all the kinds of features and facilities to getting a strong foothold in implementing your course in SOA. The API’s such as JAXB, JAXP,JAXR and the latest and the most rapid JAX-WS completely empower the developer to gain a fast entry into the SOA world.
Java EE is a huge field to enter but once you get enlightened by the amazing aspects involved in it you never tend to get out of it. In the world of Java EE you can not only play with its toys but also make your own toys or enhance the existing ones with new features. Game On!