• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DAO Pattern

 
Ranch Hand
Posts: 59
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I'm new in Hibernate and I want to know if DAO pattern is a good pattern to create the logic to persist the objects.
I don't want to write code for access hibernate methods in my servlets for instance. Also, perhaps I'll persist the objects using XML or ObjectOutputStream and than I think DAO is the best pattern to do this.
I want to discuss it.

Thanks.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Danilo,

The DAO pattern is VERY good for Hibernate, and I wouldn't write an app without it. It is also possible to create a Generic DAO to handle methods that would be common to all of your code (such as a getAll() method).

I'd be happy to provide you a code example privately, but I don't post code publicly on JavaRanch anymore.

Jason

Originally posted by Danilo Dadonas:
Hi. I'm new in Hibernate and I want to know if DAO pattern is a good pattern to create the logic to persist the objects.
I don't want to write code for access hibernate methods in my servlets for instance. Also, perhaps I'll persist the objects using XML or ObjectOutputStream and than I think DAO is the best pattern to do this.
I want to discuss it.

Thanks.

 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to add one word of caution, after having seen a number of broken DAOs
in this forum: because the level of standardization for DAOs is lower
than that of regular ORM usage, once you create your DAO layer, it's yours to maintain.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic