I agree. I think the DAO pattern can be an unnecessary layer to your application when using Hibernate or other ORM tool. If your in a J2EE environment, your SessionBean can act as a DAO layer. Hell, some JEE 5 examples do exacly that.
However, it can be useful if you think you could be changing persistence architechures and the means to access you data will change as a result. Additionally, A DAO is MUCH easier to test than a SessionBean as it does not require you test it in-container. I still use DAOs for that reason alone, otherwise its just extra code in your app.
_________________ Ryan J. McDonough
http://damnhandy.com
Please remember to rate!
|