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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "EJB versus DAO" Watch "EJB versus DAO" New topic

EJB versus DAO

Mandy Tan

Joined: Aug 09, 2006
Posts: 6

I am attempting the 2nd part of the assignment. I have a question regarding the EJB and DAO. From what i understand, DAO is a OO-pattern, so do we use DAO when we want a persistence layer without EJB and we write our own JDBC and sql code to access the database.

Or is entity bean still required ? then where does the DAO come in ?

Appreciate any clarification.

thanks & rgds
Mandy Tan
Juha Karemo

Joined: Aug 09, 2006
Posts: 1

DAO is used to abstract the data access to the persistence layer. This frees the client of DAO layer from knowing any implementation specific details, like using EJB or not. The decision to use DAO doesn't dictate that you must use JDBC to implement it. You are free to choose any implementation technology (for example EJB, Hibernate, JDBC) you find appropriate.

Mandy Tan

Joined: Aug 09, 2006
Posts: 6

So if i intend to use DAO inside my sequence diagram, I need only show the DAO and not EJB ? Cos the DAO encapsulate the db access logic, and we are free to use EJB or hibernate in our implementation.

The assignment says it has to be J2EE compliant, but right now my sequence diagram only shows JSP/servlet, session beans and DAO. No Entity Beans yet, so i am not sure whether this will be truly J2EE compliant.

Appreciate any advice.

Thanks & rgds
I agree. Here's the link: http://aspose.com/file-tools
subject: EJB versus DAO
Similar Threads
Rational Rose - Problem with dependency relationship between interface and package
Thread problem
Data Access Beans
Use of DAO in SCJEA Assignment
Struts and App Design question