Search code examples
c#repository-patternn-tier-architectureaggregateroot

Application Layers and Contracts


What is the prefered communication: IAggregationRoot marker is stored in Domain Layer and Data Access Layer references it in IRepository contract or vice versa?

EDIT

I looked at Tim Maccharty's (http://www.wrox.com/WileyCDA/WroxTitle/productCd-0470147563,descCd-authorInfo.html) implementation of repository pattern and unit of work pattern. It's very useful for unit-testing purpose to have own/fake implementation of IUnitOfWorkRepository. I got confused a little bit more with where do I store such contracts.

Thanks!


Solution

  • Stored in Domainlayer. From my point of view you don´t want to depend on the infrastructure/DAL layers from your domainLayer.

    The second best approach I´ve tried is to have a third separate assembly like DDDBaseFramework that u can resuse.