| The J2EE approach
includes Enterprise JavaBeans (EJB). The Enterprise JavaBeans
component architecture represents a highly successful step forward
in distributed computing. EJB makes it easier for developers
to write business applications using re-usable server components
without a deep knowledge of system-level programming. Enterprise
JavaBeans are a server side component model that allows for
the encapsulation of business logic. EJB provides abstraction
from system-level functions including transaction processing,
resource pooling, object-life cycle, threading, naming, remote
access, persistence and security. EJB allows developers language
and platform independence by supporting several wire protocols
such as RMI, IIOP, RMI-IIOP and DCOM.
Beans exist to provide services to clients. Enterprise JavaBeans
function in the context of an EJB Container, which, like web
containers, are typically part of an application server. Beans
receive services from the EJB Container which gets services
from the Applications server. Clients do not access container
services directly; this is the role of the bean.
There are three different Enterprise JavaBean models. These
are session beans, entity beans and message-driven beans.
Iterations of session beans are accessed by a single client,
providing the client access to server resources. Session beans
exist only as long as the connection between the session bean
and the client lasts. Session beans represent workflow, the
processes and tasks associated with business logic, and application
state and can be either stateful or stateless. Stateful beans
retain transactional and conversational data from client session
to another and stateless beans do not. The two types of session
beans have a lot in common and it is easy for developers to
move between developing stateful and stateless session beans.
Both are based on similar development models. Both implement
the javax.ejb.SessionBean interface and share container callbacks.
EJB components that represent interface objects may be stateful
or stateless session beans. But, components that represent control
objects called from EJB components representing interface objects
must use stateless session beans.
|