wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes why DAO? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "why DAO?" Watch "why DAO?" New topic
Author

why DAO?

azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Is there any valid reasons to use DAO, now that we have JPA and other orm tools.

Is there any advantage of using DAO?
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Hi azhar,

Originally posted by azhar bharat:
Is there any valid reasons to use DAO, now that we have JPA and other orm tools.

Is there any advantage of using DAO?


Just to make things a bit tangible.

  • DAO is a design pattern.
  • JPA is a specification.
  • Hibernate (ORM tool as you say) is an implementation of JPA.


  • The DAO pattern still plays the same important role in a Java EE 5 environment as it did before. No change here .

    See more here: Sun's Blueprint about the DAO Core J2EE Patterns and Generic Data Access Objects

    Regards,
    Darya


    SCJP, SCJD, SCWCD, SCBCD
    azhar bharat
    Ranch Hand

    Joined: Jul 17, 2006
    Posts: 87
    so, when using hibernate/jpa, it is a DAO pattern, am i right?
    Darya Akbari
    Ranch Hand

    Joined: Aug 21, 2004
    Posts: 1855
    No, the DAO pattern does not depend on the ORM tool you use. Look the links I gave you, for an implementation example with Hibernate.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: why DAO?
     
    Similar Threads
    Suggestion on choosing a right pattern !!
    DAO class generation with XDoclet
    Error while Proxying DAO Classes
    why is that?
    Data Access Object