wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes what comes first, the DAO or EJB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "what comes first, the DAO or EJB?" Watch "what comes first, the DAO or EJB?" New topic
Author

what comes first, the DAO or EJB?

Saha Kumar
Ranch Hand

Joined: Feb 23, 2006
Posts: 218
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

Joined: Jul 21, 2005
Posts: 164
BMP Entity beans uses DAO.
I don't see sense in using DAOs to call BMP Entity Beans.


Regards

Samuel
Saha Kumar
Ranch Hand

Joined: Feb 23, 2006
Posts: 218
Thanks, Samuel.

-Saha
Samuel Pessorrusso
Ranch Hand

Joined: Jul 21, 2005
Posts: 164
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what comes first, the DAO or EJB?
 
Similar Threads
Entity Bean and DAO
value objects are best used with cmp or bmp of entity beans?
SCEA Part 2 v1.4 Exam (Entity Vs SLSB + DAO)
BMP and DAO - what comes first
Mark Cade's Study Guide p. 28 Q13: Benefit using DAO with BMP Entity Bean