Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what comes first, the DAO or EJB?

 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

When using BMP with a DAO, should the client code use the DAO to persist the BMP entity bean, or should the client code access the entity bean (so that the DAO is internally used by the entity bean)?

I have seen examples both ways...is there a more preferred way?

Thanks in advance.
 
Samuel Pessorrusso
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BMP Entity beans uses DAO.
I don't see sense in using DAOs to call BMP Entity Beans.


Regards

Samuel
 
Saha Kumar
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Samuel.

-Saha
 
Samuel Pessorrusso
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about the concept. With BMP you will need to write all the SQL code. DAO is used to promote Database independency, therefore your BMP entity bean will use you DAO.

Imagine if you use the DAO to call the Entity Bean, when you change your database, you would need to rewrite all Entity Beans.

Regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic