Showing posts with label Active Record. Show all posts
Showing posts with label Active Record. Show all posts

Saturday, April 13, 2013

DAO vs. Active Record

The DAO pattern is a popular choice in term of implementing of Data Access Layer. There is another pattern start to be attractive to developers especially inside some Dynamic Programming languages -- The Active Record pattern. The basic idea is directly enhancing the Domain Object to do data persistence. Recommended to read more before making decision which one is better for your project.
http://www.linkedin.com/groups/EJB-entity-beans-Hibernate-dao-50472.S.120316355

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

Monday, April 30, 2012

Active Record Pattern


Therefore, typical implementations of the Active Record pattern consist of instance properties representing a record’s fields in the database, instance methods that act on that specific record and static methods acting on all records, i.e. the database table or view.
http://misko.hevery.com/2009/05/05/the-problem-with-active-record/