Chapter 19. EJB Design in the Real World

EJB changed rapidly over the past couple of years. Best practices for using EJBs “in the real world” are only now beginning to be documented, and there are already entire books on how to use EJBs. We cannot hope to cover everything in a single chapter. However, we can hit the important topics in designing EJBs for use in real-world business applications.

This chapter covers:

  • The questions you need to ask about your EJB container and database selections before you begin designing your EJBs.

  • A step-by-step how-to for designing EJBs from functional requirements to completed EJB design, including the identification of potential base classes and EJB-helper classes.

  • Alternatives to EJB. There are places where Enterprise JavaBeans are not the best choice. The last section in this chapter helps you identify those places and introduces some alternatives.

Pre-Design: Containers and Databases

Before you begin designing your application, it is essential that you consider the execution environment in which your code is run. The execution environment includes your:

Hardware platform
Operating system
Java Virtual Machine (JVM) implementation
Application server (EJB container)
Database server

Each of these elements has a direct effect on your application design’s success. We won’t talk about hardware and operating systems (about which you may have little choice, anyway), and we’ll stay away from arguments about who has a better JVM. We’ll focus on the last two issues; ...

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