• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP/BMP  RSS feed

 
tan kian
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whats the difference between the two/how do i diffrenciate them? and how am i supposed to know when which one is the one to be implemented?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The clue to the main difference is in their names: Container Managed Persistence and Bean Managed Persistence. In the former it is the container which has the responsibility of persisting data to the database, in the later it is the bean (which you write).

The general rule is supposed to be that you use BMP when you have specific persistance logic to implement which is different from how the container might implement it.

The rule I follow is never to use BMP, and almost never to use CMP. There are much better ORM stategies out there.
 
tan kian
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bean is referring to the XXXbean that i'll be coding right? so for the Container, is it referring to the XXXHome or XXXLocal or some other stuff?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tan kian:
Bean is referring to the XXXbean that i'll be coding right? so for the Container, is it referring to the XXXHome or XXXLocal or some other stuff?


Yes, but remember an EJB is all the specified components, not just the XXXHome class or whatever. For a container managed Entity Bean the implementing class will be abstract (since it ifs the container which provides this logic). Bean managed it will be concrete, and you have to provide implementing logic for each of its methods.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!