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 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2014
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