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
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.
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:
|Java Virtual Machine (JVM) implementation|
|Application server (EJB container)|
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; ...