The Village at the Keystone Resort
Colorado Software Summit
Java and XML Programming Conference
November 3 – 8, 2002
Keystone Conference Center


Dave Landers – BEA Systems, Inc.

EJB Basics – by Example

The Enterprise JavaBean (EJB) specification describes a powerful model for developing server-side components. This component model allows a developer to concentrate on programming the business logic of the component. Many of the services that are required for enterprise-level components are available via a container.

Breaking into the EJB world can be a daunting prospect, as there are many new concepts and APIs to learn. Fortunately, it is not as hard as it appears.

In this session, we will discuss the various "flavors" of EJBs: Session, Entity, and Message Driven Beans. We will look at their strengths and differences, and discuss how to choose the right type for the job.

Then, we will look at how to write a simple bean of each type. You will see exactly what you have to implement to make a basic EJB, and we will illustrate this with example code.

Next, we will look at the deployment options. Many basic services such as security and transactions are automatically available to you via the container. We will look at how to specify these options.

Then we will put it all together with an example that uses each EJB type and also shows how to use the EJBs from a client program.

Techniques for Building J2EE Applications

J2EE describes a useful set of component technologies for assembling applications. Built on top of J2SE, it adds EJB, Servlets, JSP and much more. These components can be assembled together to create server-side applications.

Unfortunately, the process of designing and assembling a real application is more complicated than simply creating a deployment descriptor and jar'ing up an EAR file. As you design your application, you will find that you have to address many other issues. Among these are:

  • Design and implementation for component reuse
  • Configuration of component properties and resources
  • Connecting components together into a final assembly
  • Application isolation when several applications are deployed to the same server
  • Deployment of non-component utility classes ("regular" Java code)
  • Hot-deploying applications without restarting the server
  • Communication with thin and thick clients

Additionally, most application server vendors offer enhancements that can make your life easier – at the expense of portability or specification compliance.

Deciding how to address these issues is important to your application design and implementation. J2EE does address many of these issues, but often does not go far enough to provide real guidance and solutions for real-world applications.

In this session, we will discuss issues you may encounter when building J2EE applications. We will look at some of the solutions and trade-offs. Of course, your view of these issues is tinted by your needs and goals, so there is no one-size-fits-all solution. I won't be proposing absolute solutions, but rather offering some of the techniques that I have found helpful.

Picture of Dave Landers

Dave Landers is a Staff Engineer with BEA Systems. He works with the WebLogic Portal team in the Boulder, Colorado office. Dave has been using Java in product development and consulting projects for over five years. He is currently specializing in J2EE and related technologies. Dave also has experience in cross-platform software development, numerical methods, scientific analysis, and data visualization. Dave is a wood turner, recycling urban scrap wood (tree trimmings) into vases, and bowls. Email:


* Return to Top *

© 1997 – 2002  Kovsky Conference Productions Inc.  All rights reserved.