O'Reilly logo

J2EE™ Applications and BEA™ WebLogic Server™ by Sandra L. Emerson, Rob Woollen, Michael Girdley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

BMP vs. CMP

An important design decision for entity bean developers is the choice between BMP and CMP.

The main advantage of BMP is its flexibility. Because the bean writer explicitly codes the data access logic, he or she has complete control over the entity bean's persistence.

While most entity beans keep a persistent representation in a database, with BMP the bean writer has the flexibility to choose any type of persistent store. For instance, BMP might be used to persist an entity bean to a legacy system.

CMP Design Advantages

A clear advantage of CMP is simplicity. With CMP, the EJB container automatically generates the data access code.

This not only makes the bean simpler, but it also separates the bean code from its persistent representation. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required