Dave Johnson on open web technologies, social software and software development
« WebSphere App Develo... | Main | java.blogs! »
If you use the DAO pattern, it is possible to completely hide your persistence mechanism from your application. It is possible, but is it a good idea? Separation of concerns and modularity are always good things, right? <a href= "http://www.freeroller.net/page/acoliver/20021125#excessive_over_engineering_flexibility_and">Andy Oliver argues that this is not always the case. I think he has a good point. You have to think about what you are trying to achieve. Sometimes separating concerns buys you nothing and just makes your system more complex.
In the case of the DAO pattern, the point is to separate the client portions of an application from the data access mechanisms and to allow the "data access mechanisms to change independently of the code that uses the data." I'm trying to understand the flexibility/complexity trade-offs of DAO. Here are the pros and cons I've assembled thus far:
Benefits of DAO pattern
Drawbacks of DAO pattern
org.exolab.castor.jdo.TimeStampable
. Damn, your persistence engine just poked it's
ugly head out from behind the curtain of DAO.What do you think? Is the DAO pattern a good thing? Is pluggable persistence a desirable design goal?
Dave Johnson in Java
05:04AM Nov 26, 2002
Comments [8]
Tags:
Java
« WebSphere App Develo... | Main | java.blogs! »
This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog
Below are the most recent entries in the category Java, some may be related to this entry.
Posted by Matt Raible on November 26, 2002 at 02:51 PM EST #
Posted by Dave on November 26, 2002 at 03:14 PM EST #
Posted by Jason Carreira on November 26, 2002 at 07:50 PM EST #
Posted by Xavi Caballé on November 27, 2002 at 08:21 AM EST #
Posted by Dave Johnson on November 27, 2002 at 11:07 AM EST #
Isnt a Value Object a plain old java object?
Is there a difference in how the relationship between entities - 1-1, 1-many, many-many are managed in Value Object as compared to DAOs?
What I would like to see is a XSD schema based approach that drives the generation of everything underneath
Posted by Shakeel Mahate on November 27, 2002 at 04:11 PM EST #
Posted by Sean on September 27, 2003 at 07:11 PM EDT #
Posted by Sean on October 11, 2003 at 02:07 PM EDT #