Library Zone Articles
External Articles
Byte Size

Discovery Zone Catalogue
Diary
Links
Bookstore
Interactive Zone Ask the Gurus
Discussion Groups
Newsletters
Feedback
Etc Cartoons
Humour
COMpetition
Advertising ASP Web Ring ASP Web Ring
Click here
The Developer's Resource & Community Site
COM XML ASP Java & Misc. NEW: VS.NET
International This Week Forums Author Central Find a Job

The EJB Lifecycle

In any enterprise development scenario, there are usually numerous complex programming issues involved, which usually require the involvement of multiple domain experts. Without addressing all these issues and cohesive team-oriented approach, it is impossible to create successful enterprise applications. To ease enterprise development, the EJB specification assigns responsibilities or roles and specifies who is responsible for delivering what in an enterprise application that uses EJBs as shown in Figure. Do note that the EJB specification does not necessarily preclude the same person from carrying out more than one role.

The lifecycle of a typical enterprise Java Bean
The lifecycle of a typical enterprise Java Bean

Let us take a closer look at the different roles that the EJB specification defines in greater detail:

EJB server provider

The EJB server provider provides an organized application framework in which to run the EJB containers. The EJB server vendor will implement and provide access to a JNDI-compatible naming service and a transaction service that is CORBA-OTS compatible. It should also be noted that the EJB server vendor might also act as the EJB container vendor.

EJB container provider

The EJB container provider provides software to install an EJB Bean with its supporting classes on an EJB server. The container vendor is also responsible for providing runtime classes that provide the required services to the EJB instances. These include the generation of stubs and skeletons classes to provide access to the EJB instance’s Home object and EJBObject, installation of references to the Home object in a JNDI-accessible namespace. Additionally, it also has to make available a suitable EJBObject implementation that can provide correct proxy services for the EJB class

EJB developer

The EJB developer should have knowledge not only of the EJB specification, but also business needs since she is responsible for coding the business logic into server side components. Basically, the developer implements EJB classes that focus on the business logic using the classes and interfaces defined in the EJB specification.

While the EJB container is responsible for handling all the transaction controls on behalf of the EJB instance, it is important that the EJB developer understands how transactions work. Consequently, it is the responsibility of the developer to stipulate to the EJB deployer the transactional needs of the various methods in the EJB class. The EJB spec calls the EJB Developer, the Enterprise Bean provider.

EJB deployer

Although the EJB deployer may not be a Java developer nor understand the business rules that an EJB class implements, she should understand the application framework in which the EJB instance runs. Additionally, she should have an in-depth understanding of the characteristics of the run-time server environment such as database types, its location, etc. The deployer is responsible for taking the EJB and all its supporting classes and installing them correctly on the EJB server.

The deployer gets the EJB class requirements from the EJB developer such as transactional needs, names and descriptions of the required environment properties and so forth. The deployer is responsible for making these properties, along with their correct runtime values available to the EJB class at runtime. The deployer also has to ensure that the Home object for the EJB class is available in the namespace and is accessible through JNDI. Naturally, it is critical that the deployer and the developer communicate clearly, to ensure that the EJB class is deployed with the correct deployment attributes.

Application developer

The application developer writes the client applications using pre-built EJB components. Here, a client is defined generally and can be a Java application, applet, servlet, a natively compiled CORBA application accessing EJB components using IIOP or even an ActiveX control connecting through a COM-CORBA bridge.

The application developer can thus plug-in ready-made EJBs without having to develop or test them or having any internal knowledge of how to integrate them. This frees her up to concentrate on high-level functionality such as data presentation without having to worry about how such data is actually obtained. The EJB spec calls the Application developer, the Application assembler.


What do you think of this article?

Have your say about the article. You can make your point about the article by mailing [email protected] (If you haven't allready joined, you can join by going to https://www.onelist.com/community/dev-java).

You can also write a review. We will publish the best ones here on this article. Send your review to [email protected]. Please include the title of the article you are reviewing.

Further Reading

The Enterprise JavaBeans Series:

Enterprise Java Beans By Gopalan Suresh Raj.
In this introduction to Enterprise Java Beans, Gopalan covers the bases then goes on to demonstrate how to build server side business object components. This article is the introduction to Gopalans series of Enterprise JavaBeans articles. (This series of articles is courtesy of Gopalan Suresh Raj)

Enterprise Java Beans Series - Components at the Server By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Model By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Naming Services and JNDI By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Transactions and JTS By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Servers By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Containers By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Components By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Session Beans By Gopalan Suresh Raj.

Enterprise Java Beans Series - EJB Entity Beans By Gopalan Suresh Raj.

Enterprise Java Beans Series - Writing an Entity Bean By Gopalan Suresh Raj.
Part 1 of a four part series: A four tier bank account example

Enterprise Java Beans Series - Writing a Session Bean By Gopalan Suresh Raj.
Part 2 of a four part series: A four tier bank account example

Enterprise Java Beans Series - Writing an EJB Client By Gopalan Suresh Raj.
Part 3 of a four part series: A four tier bank account example

Enterprise Java Beans Series - Writing an EJB Servlet Client By Gopalan Suresh Raj.
Part 4 of a four part series: A four tier bank account example


Author: Gopalan Suresh Raj

Gopalan has his own site at Author Central (visit him. He also maintains his own site at https://www.execpc.com/~gopalan/) - Contribute to iDevResource.com and you can have one too!

© Copyright 1997-2000 Gopalan Suresh Raj. Reproduced with Permission


Click here

Contribute to IDR:

To contribute an article to IDR, a click here.

To contact us at IDevResource.com, use our feedback form, or email us.

To comment on the site contact our webmaster.

Promoted by CyberSavvy UK - website promotion experts

All content © Copyright 2000 IDevResource.com, Disclaimer notice



Code Project

Java COM integration

WTL Introduction

WTL Architecture by Richard Grimes