Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.0
what is the difference between the DAO and repositery , how they are used in the project..
and also what is the relation between DAL,DAO,Repositery.
Posted 7-Feb-13 19:43pm
Edited 7-Feb-13 19:53pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

DAO is an abstraction of data persistence. Repository is an abstraction of a collection of objects.

DAO would be considered closer to the database, often table-centric. Repository would be considered closer to the Domain, dealing only in Aggregate Roots. A Repository could be implemented using DAO's, but you wouldn't do the opposite.

Also, a Repository is generally a narrower interface. It should be simply a collection of objects, with a Get(id), Find(ISpecification), Add(Entity). A method like Update is appropriate on a DAO, but not a Repository - when using a Repository, changes to entities would usually be tracked by separate UnitOfWork.

It does seem common to see implementations called a Repository that are really more of a DAO, and hence I think there is some confusion about the difference between them.


see below links for more info
http://msdn.microsoft.com/en-us/magazine/dd419654.aspx[^]
http://www.codeinsanity.com/SystemMessages/FileNotFound.aspx[^]
http://blog.fedecarg.com/2009/03/15/domain-driven-design-the-repository/[^]

http://devlicio.us/blogs/casey/archive/2009/02/20/ddd-the-repository-pattern.aspx[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 184
1 Sascha Lefévre 120
2 Abhinav S 104
3 Sergey Alexandrovich Kryukov 94
4 Richard MacCutchan 90
0 Sergey Alexandrovich Kryukov 6,628
1 OriginalGriff 6,298
2 Peter Leow 2,534
3 Maciej Los 2,492
4 Abhinav S 2,378


Advertise | Privacy | Mobile
Web04 | 2.8.150414.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100