Wednesday, May 2, 2012

Active Record vs. DDD


  1. If i have an estate and this contains regions in the country and these contain houses, the user can add new regions to the estate and houses to regions and view the houses details.
    Does this sound like something that warrents DDD or am I trying to fit something in that just doesnt fit, I cant believe this, as nearly all web based systems are just reflections over data at their core and merely provide facilities for the users to perform basic crud methods on a system. Would you model the crud methods e.g. AddRegion as a domain method or just at the service level?
    Sorry to be a pain, but this is one of the biggest hurdles I always have with DDD, if you can suggest any reading or articles, I would be extremely grateful (where did I put Erics book…)

  2. udidahan Says:
    Andrew,
    That kind of behavior can be built using the Active Record pattern instead of the Domain Model pattern. As you said, it is simple data manipulation and, as such, doesn’t require it. That said, DDD is broader than the Domain Model pattern and there are many other useful elements to it that can still be applicable.
http://www.udidahan.com/2008/02/15/from-crud-to-domain-driven-fluency/

With the Active Record Design Pattern we will focus on persistence as a responsibility rather than as a service.
 http://web.archive.org/web/20110625073754/http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx

No comments:

Post a Comment