Chapter 6. Enterprise JavaBeans

RMI and JavaBeans bring a standard distributed object framework and a component model, respectively, to the general Java environment. The Enterprise JavaBeans architecture builds on these foundations to provide a standard distributed component model for the enterprise Java environment.

So, you may ask, how are EJB components different from “regular” RMI and CORBA distributed objects or nondistributed JavaBeans components? Well, in a nutshell (so to speak), an EJB includes the capabilities of both and adds an entire set of enterprise services. An EJB component has the remote capabilities of an RMI or CORBA object, in the sense that it can be exported as a remote object using RMI or RMI/IIOP. An EJB component is also a JavaBeans component since it has properties that can be introspected and it uses JavaBeans conventions for defining accessor methods for its properties. The EJB architecture provides a framework in which a developer can easily take advantage of transaction processing, security, persistence, and resource-pooling facilities provided by an EJB container. These facilities don’t come for free, of course. You need to understand how they work and what rules your EJB object needs to follow in order to take advantage of these services.

Enterprise JavaBeans are useful in any situation in which regular distributed objects are useful. They excel, however, in situations that take advantage of the component nature of EJB objects and the other services ...

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.