What is the difference between a BMP EntityBean and a DAO ?  
Author Message
LarsWill





PostPosted: 2004-10-16 18:15:00 Top

java-programmer, What is the difference between a BMP EntityBean and a DAO ? 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





PostPosted: 2004-10-17 2:37:00 Top

java-programmer >> What is the difference between a BMP EntityBean and a DAO ? Lars Willich wrote:

> 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





PostPosted: 2004-10-17 12:32:00 Top

java-programmer >> What is the difference between a BMP EntityBean and a DAO ? 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

"Lars Willich" <email***@***.com> wrote in message
news:ckqsbm$ulg$04$email***@***.com...
> 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
>