Back to list
Views:   15.1K
Replies:  3

What is the role of DAOs (Data Access Objects)?


I have a question on data access.  Why are DAOs (Data Access Objects) used to run queries against the database?  I thought that this was the job of the Repository?

I am going through the Design Pattern Framework's MVC application.  The controller calls the Repository and the Repository calls the Service.  Then in the service a Data Access Objects are called to retrieve data  Why is it done this way?

Am I missing something?  Why is there a Repository Pattern?

Any comments would be appreciated.

Brendan Vogt, Jan 04, 2011
Reply 1
I would suggest you to read for understanding Respositry pattern.
Raghu Raghavan, Feb 01, 2011
Reply 2
To make   design Loosely Coupled!
Mohammed Sarfaraz, Jan 23, 2011
Reply 3
Rather than The Controller => Repository => Service  the following is more flexible approach

Controller => Service => Repository => Data Access Engine

Because, the service should be the entry point into your app and this will help you in case where request is coming from different clients like web, portable device, smartclient manage all the logic at one place rather than splitting between repository and services.

A good writeup on repository pattern can be found here

Hope this helps.

Rajesh Pillai, Jan 10, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.