12 November 2005

EJB 3.0: Development made easy

The EJB 3.0 expert committee released a public review of the EJB 3.0 specification on 27th June, 2005. One of the primary goals of the new release is reducing the complexity of EJB architecture from a developer's point of view and to simplify application development.

Some of the pain areas of earlier releases (like 2.x) of the specification are:
  • Multiple interfaces need to be implemented.
  • Unwanted life cycle methods needs to be implemented like ejbPostCreate, ejbPassivate, ejbActivate.
  • Mandatory to handle checked exceptions like CreateException, FinderException etc.
  • Client lookup is cimplex and exposes JNDI details.
  • Deployment descriptor gets verbose and is error prone.
  • Hard to unit test ejbs outside the container.
The expert group has brought radical changes in the architecture of EJB in release 3.0. Some of the salient features of the new release which will make life of developers easy are:
  • Every thing is either POJO or POJI (Plain Old Java Object/Interface).
  • Persistence model is in line with Hibernate or Toplink.
  • Annotations has replaced deployment descriptor
  • Client view is much simpler.
  • Life cycle methods are optional.
  • Support for primary key generation is case of entity beans.
  • Number of artifacts is less. No need to implement Home interface.
All these feature will result in easier development and deployment of EJB base J2EE applications. However, the release is still work in progress. Current status of the release is available at JSR 220: EJB 3.0. It will take some time before the new specification is ready and all application server vendors start supporting it.

JBoss and Oracle are however providing
EJB 3.0 preview releases for their application servers.

Recently, I have written an article on EJB 3.0 which was published an by Jax Magazine. I the article I have implemented a simple application using
EJB 3.0 Beta 1 from JBoss to check the new features of the specification first hand. Check out the article and let me know your feedback.

No comments: