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
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
Wednesday, May 2, 2012
Active Record vs. DDD
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
In the ActiveRecord you have one domain object that both knows all the business logic and how to save/update itself in the database, user.getLinkToProfile() and User::find(1), User::save(user)
thr - http://stackoverflow.com/questions/93773/how-does-the-activerecord-pattern-differ-from-the-domain-object-or-data-mapper-p
http://misko.hevery.com/2009/05/05/the-problem-with-active-record/
Subscribe to:
Posts (Atom)
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…)
January 23rd, 2010 at 9:32 pm 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.