EJB stands for "Enterprise JavaBeans" which are distributed network aware
components for developing secure, scalable, transactional and multi-user
components in a J2EE environment.
A D V E R T I S E M E N T
Above definition actually describes EJBs from functional point of view i.e. what
they do. A more structural definition would be : "EJBs are collection of Java
classes, interfaces and XML files adhering to given rules".
Written in the Java programming language, an enterprise bean is a server-side component
that encapsulates the business logic of an application.
Benefits of Enterprise Beans
For several reasons, enterprise beans simplify the development of large,
distributed applications. First, because the EJB container provides system-level
services to enterprise beans, the bean developer can concentrate on solving
business problems. The EJB container--not the bean developer--is responsible for
system-level services such as transaction management and security authorization.
Second, because the beans--and not the clients--contain the application's
business logic, the client developer can focus on the presentation of the
client. The client developer does not have to code the routines that implement
business rules or access databases. As a result, the clients are thinner, a
benefit that is particularly important for clients that run on small devices.
Third, because enterprise beans are portable components, the application
assembler can build new applications from existing beans. These applications can
run on any compliant J2EE server.
When to Use Enterprise Beans
You should consider using enterprise beans if your application has any
of the following requirements:
The application must be scalable. To accommodate a growing number of
users, you may need to distribute an application's components across
multiple machines. Not only can the enterprise beans of an application run
on different machines, but their location will remain transparent to the
Transactions are required to ensure data integrity. Enterprise beans
support transactions, the mechanisms that manage the concurrent access of
The application will have a variety of clients. With just a few lines of
code, remote clients can easily locate enterprise beans. These clients can
be thin, various, and numerous.
The EJB Ecosystem
To have an EJB deployment up and running, one needs more than an application
server and components. There are six more parties that are involved:
The Bean provider: The bean provider supplies the business
components to the enterprise applications. These business components are not
complete applications but can be combined to form complete enterprise
applications. These bean providers could be an ISV selling components or an
internal component provider.
The Application Assembler: The application assembler is
responsible for integrating the components. This party writes applications
to combine components so as to develop the target application that can be
deployed under various environments.
The EJB Deployer: After the application developer builds the
application, the application must be deployed on the server. This involves
configuring the security parameter settings, performance tuning, etc. An
application assembler is not familiar with these issues. This is where the
EJB deployer comes into play.
The System Administrator: The system administrator is responsible
for the upkeep and monitoring of the deployed system and may make use of
monitoring and management tools to closely observe the deployed system.
The Container and Server providers: The container provider
supplies the EJB container (an application server). This is the runtime
environment where the beans live. The container supplies the middleware
services to the beans and manages them. Some of the various containers are:
BEA's WebLogic, iPlanet's iPlanet Application Server, IBM's WebSphere,
Oracle's Oracle 9i Application Server and Oracle 10g Application Server, and
the JBoss open source Application Server. The server provider is the same as
the container provider.
The Tool Vendors: There are various IDEs available to assist the
developer in rapidly building and debugging components, for example Eclipse,
NetBeans, and JBuilder. For the modeling of components one can use Rational
Rose. There are many other tools, some used for testing (JUnit) and others
used for building (Ant, XDoclet).