1.Why EJB ?
•
The benefit to application developers is that they can focus onwriting the business logic without worrying much aboutimplementing the surrounding framework.
•
The main difference between JavaBeans and EJB is that when youuse JavaBeans to create a server application, you have to buildthe entire server framework. With EJB the framework is providedfor you; you simply have to conform to its APIs.
•
It follows the Java’s “Write once and run anywhere” concept. It isplatform independent.
•
It makes distributed programming (RMI/CORBA) easier.
•
All the transaction processing is taken care by the EJB server.
•
It follows the multithreaded architecture.
2.
What is the EJB architecture like ?
•
It is logically a three-tier architecture consisting of mainly TheClient The EJB server and The Databases.
•
The EJB bean resides in the container , which in turn reside onthe EJB server.
•
A program on the client side makes remote calls to the EJBs.Theclient can never communicate directly with the EJB beans.
•
It talks to the EJB bean through the Home and Remote interfacesprovided by the container.3.What is the role of the container ?
•
An container is an enviroment in which the EJBs execute.
•
It can contain one or more EJB classes.
•
The container is resposible for generating the implementations of the Home and Remote interfaces.
•
Clients can never connect to the EJB bean itself , rather theyconnect to the representation of the EJB(EJBObject) provided bythe container , which then forwards the clients request to theEJB.
•
The container provides the following facilities :
•
Swapping to and from secondary storage(for session beans).
•
Persistence management (for entity beans).
•
Creation and lookup of the Home object through the JNDI(Java Naming & Directory Interfaces) accessible namespace.
•
Supports management of multiple Instances.
•
Implementation of certain basic security services.
•
Support for transactions management.4.What does the Home interface do ?
•
The EJBHome object must implement the home interface.
1
Leave a Comment