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? 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.
This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)
This is a personal weblog, I do not speak for my employer.

Buy now from Amazon.com
Or direct from Manning
| « August 2008 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | ||||||
3 | 5 | 6 | 7 | 9 | ||
10 | 12 | 14 | 16 | |||
17 | 19 | 20 | 21 | 22 | 23 | |
24 | 29 | 30 | ||||
31 | ||||||
| Today | ||||||
Allen Gilliland
Anil Gangolli
Dan Axon
Danese Cooper
Film Babble Blog
Geertjan's Weblog
Henri Yandell
James Robertson
Jim Grisanzio
Josh Staiger
Linda Skrocki
Pat Chanezon
Rama
Ruby Sinreich
Simon Phipps
Tim Bray
Will Snow
Janne Jalkanen
Joe Gregorio
Matt Raible
Mike Cannon Brookes
Rafe Colburn
Sam Ruby
Simon Brown
My other sites
Posted by Matt Raible on November 26, 2002 at 11:51 AM EST #
Posted by Dave on November 26, 2002 at 12:14 PM EST #
Posted by Jason Carreira on November 26, 2002 at 04:50 PM EST #
Posted by Xavi Caballé on November 27, 2002 at 05:21 AM EST #
Posted by Dave Johnson on November 27, 2002 at 08:07 AM EST #
Posted by Shakeel Mahate on November 27, 2002 at 01:11 PM EST #
Posted by Sean on September 27, 2003 at 04:11 PM EDT #
Posted by Sean on October 11, 2003 at 11:07 AM EDT #