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.