Recommendations

Use BMP only if there is no way to handle persistence with CMP. There are many reasons to use CMP, such as performance or portability over different types of databases.

If you have to use BMP, then implement the bean by subclassing a CMP 2.0 bean. We are following this recommendation and we use this approach in developing the BMP sample in this chapter.

BMP as subclass of a CMP

How does this approach work?

  • Create a CMP entity bean as if you were going to implement persistence using CMP.

  • Do not create any interfaces and do not generate deployed code. The only part we are going to use is the abstract bean class.

  • Code the business methods in the bean class using the abstract getter and setter methods.

  • The BMP bean extends the CMP ...

Get EJB 2.0 Development with WebSphere Studio Application Developer 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.