Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Domain Driven Design and Hibernate

 
Kris Woo
Greenhorn
Posts: 2
IBM DB2 Eclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Not too sure which forum section this would belong to (here, OO or the Java EE), but just needed some thoughts on the follow issue.

I've worked mainly on JEE applications which uses domain driven design, so all our domain objects use encapsulation, uses factory methods for creating them and contains business logic.

Starting a new project with the intention to use Hibernate, however it seems that using hibernate it will break the use of encapsulation and make a full domain driven design very difficult to manage.

I've came across the following blog entry which someone has attempted to implement this with hibernate. DDD and Hibernate.

Has anyone else came across this issue? I'd like to hear what others think, if you have any pages, text, books that would help please post them and I'll take a look.

Thanks,
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at Spring Roo. One of the configuration options (the only one they used to support ) is the active record pattern. Creating a project with Spring Roo and having a look at the code it generates may help you move along in the right direction, although I would not classify it as DDD in the strictest sense it does move in that direction.

Another code generation project I have seen but not tried, specifically states it supports domain driven design can be found here:
http://java.dzone.com/articles/promote-quality-sculptor

I am not necessarily promoting extended use of either of these tools but I am saying that playing with them a little bit and examining the output might give you some insight on how to achieve your goal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic