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

Hibernate and Design Patterns

 
Paul Lungu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us a idea of what design patterns you find most common & useful using Hibernate as ORM in web app. There are many implementations of MVC pattern SpringMVC, Struts, Struts2, etc... Do you have any preference? One that you find mixes well with other design patterns to quickly overcome common ORM/OOP mismatch?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn! Welcome to the JavaRanch.

In personal experience, I'm always using the DAO pattern with Hibernate, although there is a debate from time to time as to whether that's an antiquated pattern or not, now with all of these entity managers and whatnot.

 
Paul Lungu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have often used the DAO design pattern, excellent for managing more simple relationships with Hiberante. The DTO design pattern adds an extra layer to the application but really separates the the object model from the data layer. I know that this is what hibernate is supposed to do but I have often found it useful to have another layer of abstraction (a pure object layer).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic