Enterprise JavaBeans (EJB) technology is the server-side component architecture for the Java 2 Platform, Enterprise Edition (J2EE) platform. One of the Primary objective of EJB’S is to provide a component model for business objects. Business objects are defined as objects that effectively organize the information –processing behavior of the business running the software system. Since every business have their own set of rules ,we require building and management of custom EJB’S. Enterprise Java beans hence provide various types ob building blocks for enterprise applications. There are four types of EJB’S , each providing a different behaviour to their clients
Stateless session beans
Stateful session beans
Entity beans
Message driven beans
Session beans
Session beans provide Synchronous Messaging-means the client must wait while the EJB is busy processing each method request. This enables the EJB to return a value from the server-side EJB to a local or remote client.
Stateless session beans(SLSB)
Stateless session beans are session beans that do not manage client state. This means that any state must be passes through method parameters. These beans, along with message driven beans ,are the most efficient EJB available. SLSB can be pooled (which happens most of the time), where subsequent calls from the same client will usually not invoke the same bean instance.
Stateful session beans
Stateful session beans are memory-based components that manage client state. Each stateful session bean is created by one client, and can maintain state on behalf of that client. Because of this, these EJB’S cannot be pooled and are not as efficient as stateless session beans.
Entity beans
Entity bean are the only persistent EJB type bean specially modeled for persistent business data. These enterprise beans maintain both a memory instance of the stateful component and a persistent store entry . . Entity Bean can support a wide variety of persistent stores, but relational database management systems are the most common and best supported. Entity beans also provide Synchronous Messaging-means the client must wait while the EJB is busy processing each method request. This enables the EJB to return a value from the server-side EJB to a local or remote client.
Message Driven Beans(MDB)
Message driven bean provide integration between synchronous EJB components and Asynchronous JMS messaging. Session and entity beans are based up on request/reply model that is the client makes a request and waits for the component to complete its processing and then return a response before resuming its next statement, whereas in asynchronous messaging it is guaranteed delivery system so the client can continue on processing with other statements.
|