views:

96

answers:

2
+4  Q: 

DDD with Grails

I cannot find any info about doing Domain Driven Design (DDD) with Grails.

I'm looking for any best practices, experience notes or even open source projects that are good examples of DDD with Grails.

A: 

try reading Grails in Action, it's in Chapter 3. it is presented by letting you work on a sample project and even shows step-by-step procedure on how to build it from scratch as well as adding plugins, etc. I highly recommend that book, very valuable reference.

note that i'm a new grails user too.

firnnauriel
Grails in Action is a great book, but it does not relate directly to DDD -http://domaindrivendesign.org/
Paul
+2  A: 

Currently I am not aware of any books that relate to Grails and DDD. Personally I would not concentrate on Grails only. Domain Driven Design is a way of thinking, a way of organizing your application and code. Thus it is not bound to technology.

The MVC paradigm does not consider models to be data access objects. In fact it does not even mention the data access layer as it is understood to be underneath/encapsulated by the model. This introduces some pitfalls when trying to utilize DDD with MVC technologies based on the ActiveRecord pattern which merges domain logic and data access code into the model. It works very well... especially in simple applications with little domain logic where there is no real distinction to be made. But when things get more complex, one should keep in mind that model != data access.

Personally I would consider improving my understanding of DDD:

Cheers!

lunohodov
Thanks for the input. I agree that DDD is a mindset not bound to any technology. In this case I'm interested in how people do DDD with Grails specifically because Grails is an opinionated framework where the default implementation patterns do not lend themselves to DDD because of the coupling of domain logic and data access - as you point out. I would say that it is easier to do DDD with ASP.Net MVC as the framework is relatively neutral regarding the data access patterns.
Paul
Continued - It's not a specific ailment of MVC that hampers the application of DDD, rather the conventions of the Grails framework (I think Rails shares these conventions). I'm a Grails fan and not detracting from the framework, rather trying to gain an insight into how others use Grails.
Paul