Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ORM Frameworks  RSS feed

 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Does your book mention any pitfalls or antipatterns related ORM frameworks such as Hibernate.

Thanks.
 
Bill Karwin
author
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anil, your question is related to the question Wouter asked earlier.
http://www.coderanch.com/t/508679/JDBC/java/ORM-Antipatterns

I have a chapter describing how some ORM users confuse "model" with "table," and this confusion impacts their application design. Martin Fowler calls this the Anemic Domain Model: http://martinfowler.com/bliki/AnemicDomainModel.html

The confusion between model and table is pretty common in the Ruby, PHP, Python, and Perl developer communities, but I haven't found this to be as much of a problem in the Java community.

My advise is to decouple the model from the database access object. Treat them as two separate objects.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!