Difference Between Similar Terms and Objects

Difference Between BMP and CMP

java_beans_bookBMP vs CMP

CMP, or Container Managed Persistence, is known to be the simplest for bean developers to create, and is known to be the most complicated for the EJB servers to support. In CMP, there is no need for bean developers to write any data access logic; all the needs are taken care of by the EJB server.

BMP, or Bean Managed Persistence, is known to manage synchronizing its state with databases, as engaged by the container.

For a CMP bean developer, there is no need to worry about JDBC code and transactions, as all databases are automatically handled by the container. On the contrary, a BMP developer will have the responsibility of the transactions and all the databases.

Another difference that can be noticed between the Container Managed Persistence and the Bean Managed Persistence, is that the former uses the EJB query language. On the other hand, a Bean Managed Persistence developer has to write the data code either in EJB, or in DAO. Well, in this case, it is more of a challenge to the BMP developer, than the CMP developer.

If a person is using CMP, they would need a more sophisticated application server, than what is needed for a BMP.

Some have said that the Bean Managed Persistence offers a tactical approach, whereas the Container Managed Persistence offers a more strategic approach.

In BMP, it is the developer who handles everything. On the contrary, it is the vendor who takes care of everything in a CMP. Another thing that can be seen is that a person will be able to optimize the queries in BMP, as it uses hard coded queries. Well, a person using CMP cannot optimize the performance, as it is the vendor who takes care of everything.

Summary

1. For a CMP bean developer, there is no need to worry about JDBC code and transactions, as all databases are automatically handled by the container. On the other hand, a BMP developer will have the responsibility of the transactions and all databases.

2. The CMP uses EJB query language. A BMP either writes the data code in EJB, or in DAO format.

3. Bean Managed Persistence offers a tactical approach, whereas the Container Managed Persistence offers a more strategic approach.

4. If a person is using CMP, they would need a more sophisticated application server, than what is needed for a BMP.

5. In BMP, it is the developer who handles everything. On the contrary, it is the vendor who takes care of everything in a CMP.

Sharing is caring!


Search DifferenceBetween.net :




Email This Post Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.


1 Comment

  1. GREAT…. exactly what i was looking for.

Leave a Response

Please note: comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Articles on DifferenceBetween.net are general information, and are not intended to substitute for professional advice. The information is "AS IS", "WITH ALL FAULTS". User assumes all risk of use, damage, or injury. You agree that we have no liability for any damages.


See more about : , ,
Protected by Copyscape Plagiarism Finder