What Is Enterprise JavaBeans?

When Java™ was first introduced in the summer of 1995, most of the IT industry focused on its graphical user interface characteristics and the competitive advantage it offered in terms of distribution and platform independence. Those were interesting times. The applet was king, and only a few of us were attempting to use it on the server side. In reality, we spent about half of our time coding and the other half trying to convince management that Java was not a fad.

Today, the focus has broadened considerably: Java has been recognized as an excellent platform for creating enterprise solutions, specifically for developing distributed server-side applications. This shift has much to do with Java’s emerging role as a universal language for producing implementation-independent abstractions for common enterprise technologies. The JDBC™ API is the first and most familiar example. JDBC ( Java Database Connectivity) provides a vendor-independent Java interface for accessing SQL relational databases. This abstraction has been so successful that it’s difficult to find a relational database vendor that doesn’t support JDBC. Java abstractions for enterprise technologies have expanded considerably to include JNDI for abstracting directory services, JTA ( Java Transaction API) for abstracting access to transaction managers, JMS ( Java Message Service) for abstracting access to different message-oriented middleware products, and more.

Enterprise JavaBeans, first introduced as a draft specification in late 1997, has since established itself as one of the most important Java enterprise technologies provided by Sun Microsystems. EJB provides an abstraction for component transaction monitors (CTMs), which represent the convergence of two technologies: traditional transaction-processing (TP) monitors (such as CICS, TUXEDO, and Encina), and distributed object services (such as CORBA, DCOM, and native Java RMI). Combining the best of both technologies, component transaction monitors provide a robust, component-based environment that simplifies distributed development while automatically managing the most complex aspects of enterprise computing, such as object brokering, transaction management, security, persistence, and concurrency.

Enterprise JavaBeans defines a server-side component model that allows business objects to be developed and moved from one brand of EJB container to another. A component (i.e., an enterprise bean) presents a simple programming model that allows the developer to focus on its business purpose. An EJB server is responsible for making the component a distributed object and for managing services such as transactions, persistence, concurrency, and security. In addition to defining the bean’s business logic, the developer defines the bean’s runtime attributes in a way that is similar to choosing the display properties of visual widgets. The transactional, persistence, and security behaviors of a component can be defined by choosing from a list of properties. The end result is that EJB makes developing distributed-component systems that are managed in a robust transactional environment much easier. For developers and corporate IT shops that have struggled with the complexities of delivering mission-critical, high-performance distributed systems using CORBA, DCOM, or Java RMI, EJB provides a far simpler and more productive platform on which to base development efforts.

When Enterprise JavaBeans 1.0 was finalized in 1998, it quickly become a de facto industry standard. Many vendors announced their support even before the specification was finalized. Since that time, EJB has been enhanced twice. The specification was first updated in 1999, to Version 1.1, which was covered in the second edition of this book. The most recent revision to the specification, Version 2.0, is covered by this, the third edition of Enterprise JavaBeans. This edition also covers EJB 1.1, which is for the most part a subset of the functionality offered by EJB 2.0.

Products that conform to the EJB standard have come from every sector of the IT industry, including the TP monitor, CORBA ORB, application server, relational database, object database, and web server industries. Some of these products are based on proprietary models that have been adapted to EJB; many more wouldn’t even exist without EJB.

In short, Enterprise JavaBeans 2.0 and 1.1 together provide a standard distributed-component model that greatly simplifies the development process and allows beans developed and deployed on one vendor’s EJB server to be easily deployed on a different vendor’s EJB server. This book will provide you with the foundation you need to develop vendor-independent EJB solutions.

Get Enterprise JavaBeans, 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.