EJB.4.1 Enterprise Beans as Components


EJB.4.1 Enterprise Beans as Components

The Enterprise JavaBeans architecture is an architecture for component-based distributed computing. Enterprise beans are components of distributed transaction-oriented enterprise applications.

EJB.4.1.1 Component Characteristics

The essential characteristics of an enterprise bean are:

  • An enterprise bean typically contains business logic that operates on the enterprise's data.

  • An enterprise bean's instances are created and managed at runtime by a container.

  • An enterprise bean can be customized at deployment time by editing its environment entries.

  • Various services information, such as a transaction and security attributes, are separate from the enterprise bean class. This allows the services information to be managed by tools during application assembly and deployment.

  • Client access is mediated by the container in which the enterprise bean is deployed.

  • If an enterprise bean uses only the services defined by the EJB specification, the enterprise bean can be deployed in any compliant EJB container. Specialized containers can provide additional services beyond those defined by the EJB specification. An enterprise bean that depends on such a service can be deployed only in a container that supports that service.

  • An enterprise bean can be included in an assembled application without requiring source code changes or recompilation of the enterprise bean.

  • The bean provider defines a client view of an enterprise bean. The bean provider can manually define the client view or it can be generated automatically by application development tools. The client view is unaffected by the container and server in which the bean is deployed. This ensures that both the beans and their clients can be deployed in multiple execution environments without changes or recompilation.

EJB.4.1.2 Flexible Component Model

The enterprise bean architecture is flexible enough to implement components such as the following:

  • An object that represents a stateless service.

  • An object that represents a conversational session with a particular client. Such session objects automatically maintain their conversational state across multiple client-invoked methods .

  • An entity object that represents a business object that can be shared among multiple clients.

Enterprise beans are intended to be relatively coarse-grained business objects (e.g., purchase order, employee record). Fine-grained objects (e.g., line item on a purchase order, employee's address) should not be modeled as enterprise bean components.

While the state management protocol defined by the Enterprise JavaBeans architecture is simple, it provides an enterprise bean developer great flexibility in managing a bean's state.

A client always uses the same API for object creation, lookup, method invocation, and removal, regardless of how an enterprise bean is implemented or what function it provides to the client.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net