• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

CMP/BMP

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Would you like to try a free sample? Today we are featuring tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic