Enterprise javabeans – Apple WebObjects 5 User Manual
Page 88

88
Enterprise JavaBeans
Apple Computer, Inc. January 2002
C H A P T E R 7
J2EE Integration
Enterprise JavaBeans
Enterprise JavaBeans (EJB) is a specification that provides an infrastructure through
which vendors can develop solutions that can be used by other vendors. The major
part of these solutions are enterprise beans. Enterprise beans are business objects
that contain logic used to perform specific tasks. They are similar to enterprise
objects in WebObjects, but can be used in application servers by multiple vendors.
When an application uses enterprise beans, it’s said that the application is a client of
the bean. (Beans can themselves be clients of other beans.) Client applications don’t
access enterprise-bean instances directly. Instead, they interact with bean stubs.
These stubs contain only the bean’s methods that are to be accessed by client
applications. Other implementation-specific methods are hidden from the client,
facilitating changes and updates to the bean’s business logic.
Enterprise beans are deployed in an EJB container (or bean container). The EJB
container manages the lifecycle of enterprise-bean instances. In addition, the bean
container can perform any database work required by the bean, allowing the bean
developer to concentrate on business problems. When necessary, however,
enterprise beans can execute database transactions themselves. Because client
applications interact with bean stubs, not the bean instances themselves, bean
containers are free to implement the EJB specification in a way that maximizes
efficiency and performance, without affecting the functionality of client
applications or the enterprise beans they contain.
To make enterprise beans available to WebObjects applications, you need to create
a bean framework. Project Builder can assist you in creating such frameworks. You
can create a bean framework using third-party enterprise beans, either from source
code or JAR (Java archive) files, or you can write your beans from scratch.
For more information on Enterprise JavaBeans in WebObjects, see Developing EJB
Applications.