|
There are three kinds of EJB's-
Session beans: Session beans are construct in EJB. They represent business logic of an application. They represent a group of logical related functioanality.
There are two types of session beans:
Stateless: they do not maintain state across method calls. So every time client makes a call its like a new object from scratch.
Stateful: These beans can hold client state across method invocations. This is possible with the use of instance variables declared in the class definition. Every time the client calls it they can get there previous states.
Stateless session bean provide greater scalability as EJB container does not have to maintain state across method invocations. Storing state for EJB container is huge activity.
- Entity beans: Entity bean represent persistent data in an EJB application. They provide object oriented abstraction to a relational database. When session bean needs to access data it calls the entity beans. Entity beans do read, write, update and delete from tables.
-
Message driven beans: There are situations in project where you would like to communicate asynchronously with some other systems. This is achieved by using message driven beans.
|