EJB
EJB is a server-side software element that summarizes business logic of an application
Enterprise Java Beansweb repository yields aruntime domainfor web related software elements includingcomputer reliability,Java Servlet Lifecycle (JSL) management,transaction procedureand otherweb services.
Types
- Session Bean: Session bean contains business logic that can be invoked by local, remote or webservice client.
- Message Driven Bean: Like Session Bean, it contains the business logic but it is invoked by passing message.
- Entity Bean: It summarizes the state that can be remained in the database. It is deprecated. Now, it is replaced with JPA (Java Persistent API).
When to use Enterprise Java Beans
- Application needs
Remote Access. In other words, it isdistributed. - Application needs to be
scalable. EJB applications supportsload balancing,clusteringandfail-over. - Application needs
encapsulated business logic. EJB application is differentiated from demonstration and persistent layer.