Enterprise Java Bean (EJB)

 Enterprise Java Bean (EJB)


The Enterprise JavaBeans (EJB) specification formally defines a Java server side component model and a programming interface for application servers. Developers build the components , called enterprise beans , to contain the business logic of the enterprise. Enterprise beans run on an EJB server that provides services such as transaction management and security to the beans. Developers don't have to worry about programming these low-level and complex services, but can focus on encapsulating the business rules of an organization or system within the beans, knowing that the services are available to the beans when they are needed.

 

In a multi-tier application, only the user interface stays on local machines while the logic of the application runs in the middle tier on a server. The final tier is still the stored data. When the logic of an application need updating, changes are made to the software of the middle tier on the server , greatly simplifying the management of updates.

 

But creating reliable, secure, and easily managed distributed applications is notoriously difficult. For example , managing transactions over a distributed systems relieves much of the burden by:

 

v Dividing the development of a distributed system into specific tasks that are assigned to specialists. For example, if the application is an accounting system, the enterprise bean developer would need to understand accounting. The system administration must know about monitoring a deployed  and running application. Each specialist assumes a particular role.

v Making EJB server and container services available to the enterprise bean and application developers. The EJB server provider and EJB container provider (who are often the same vendor) handle many of the more difficult tasks so the developers don't have to. For example, the container an enterprise bean runs in can provide transaction and security services to the bean automatically.

v Making enterprises beans portable. Once a bean is written , it can be deployed on any EJB server that adheres to the Enterprises JavaBeans standard. Each bean is likely to include vendor specific elements, however.



EJB Architecture

 

Multi-tier distributed applications often consist of a client that runs on a local machine , a middle-tier that runs on a server that contains the business logic, and a backend-tier consisting of an enterprise information system (EIS).

 

An EIS can be a relational database system, an ERP system, a legacy application, or any data store that holds the data that needs to be accessed. This figure shows a typical EJB multi-tier distributed system with three tiers: the client; the server, the container, and the beans deployed on them; and the enterprise information system.

 

The EJB Server

 

The EJB server provides system services to enterprises beans and manages the containers in which the beans run. It must make available a JNDI accessible naming service and a transaction service. Frequently an EJB server provides additional features that distinguish it from its competitors.

 

 

The EJB Container

 

A  container is a runtime system for one or more enterprise beans. It provides the communication between the beans and the EJB server. It provides transaction, security, and network distribution management. A container is both code and a tool that generates code specific for a particular enterprise bean. A container also provides tools for the deployment of an enterprise bean, and a means for the container to monitor and manage the application.

 

The EJB server and EJB container together provide the environment for the bean to run in. The container provides management services to one or more beans. The server provides services to the bean, but the container interacts on behalf of the beans to obtain those services.

No comments:

Post a Comment