Dave Johnson on open web technologies, social software and software development
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