Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why DAO?

 
azhar bharat
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
     
    azhar bharat
    Ranch Hand
    Posts: 87
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    so, when using hibernate/jpa, it is a DAO pattern, am i right?
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic