4.7. Key Point Summary

The Music EJB accesses a database through the JDBC API. Because this access is read only, we implement our business process with a session bean. A stateless session bean is appropriate because keeping track of client-specific state is not necessary.

The Music EJB uses the Value Object pattern introduced in the previous chapter. In addition, we introduce the Data Access Object pattern, which abstracts persistence operations into a separate helper class. Using an interface for vendor-independent database access helps implement classes that work with a particular vendor's SQL implementation. A factory instantiates the correct implementation class by looking up the class name in the naming context environment entry.

Here are ...

Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications 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.