• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why not BMT Entity Bean?

 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please explain why entity bean cannot have BMT? Sorry if this topic has already been posted here.

Thanks.
[ August 12, 2004: Message edited by: Keerthi P ]
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Keerthi P:
Can someone please explain why entity bean cannot have BMT? Sorry if this topic has already been posted here.

Thanks.

[ August 12, 2004: Message edited by: Keerthi P ]


I think because the Container decides WHEN to go to the database, basing it's decisions on the entity bean lifecycle. Even with BMP, the bean developer should only write the code to access/update the database, in the container callbacks methods. If you then want to use all the capabilities of the Container, thus CMP, the Container writes not only the implementation class for your ABSTRACT entity class, but also all the code that access/updates the database, not to speak about finder and select methods. In such a scenario results quite difficult to immagine a possible BMT approach. I think the container gives you high level methods just to tell you WHEN thing happen, but it does all the LOW-LEVEL work. Now, with entity bean, the real things happen at the low-level, while with session beans, the real things happen in the business methods, which you should implement. A part from the bean lifecycle there is nothing the container does in a session bean at low-level, therefore the bean developer has got complete control over the business logic.
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes... silly me . It is not possible to demarcate the transaction in the ejbLoad() and ejbStore() and the methods that are abstract in case of a CMP bean - if we want to use BMT.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic