As I read in a couple of articles a BMP (Bean Managed Persistence is an EntityBean
where the programmer has to care about the SQL statements.
On the other side a DAO implements the direct access to an SQL database.
But isn't that the same?
What are the differences ?
Lars
Michael Borgwardt - 16 Oct 2004 19:36 GMT
> As I read in a couple of articles a BMP (Bean Managed Persistence is an EntityBean
> where the programmer has to care about the SQL statements.
> On the other side a DAO implements the direct access to an SQL database.
Actually, neither necessarily uses SQL, though it's of course the most
common case.
> But isn't that the same?
> What are the differences ?
IMO the main difference is that a DAO isn't necessarily an EJB. i.e.
Entity Beans that use BMP are a special kind of DAO.
Paul & Neelam Checknita - 17 Oct 2004 05:31 GMT
You're not really comparing the like with the like. A DataAccessObject is a
core J2EE pattern -- among other things, it abstracts potentially
vendor-specific calls to a database from business objects. A
DataAccessObject could be utilized with something like BMP. A BMP
EntityBean is an entity object that manages its own persistence. Which
means that the bean implements its own persistence by including
JDBC/SQLJ/etc right in the entity bean methods.
See the following article, which explains it in further detail,
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
NC
> As I read in a couple of articles a BMP (Bean Managed Persistence is an EntityBean
> where the programmer has to care about the SQL statements.
[quoted text clipped - 4 lines]
>
> Lars