My domain entities are lined up like a tree:
Root
- Child 1
-- Child 1.1
-- Child 1.2
- Child 2
-- Child 2.1
-- Child 2.2
We ended up with 2 (rather strong) opinions on how a repository should be designed around these domain objects:
Opinion 1:
I need 2 repositories Child1Repository & Child2Repository which gets managed by a RootFacade/RootManager class to call the appropriate method on the repository. The 2 child repositories handle only the DAL operations while the RootFacade is the BLL. The RootFacade exposes DTO's to the application while internally all the 3 repositories use domain objects
Opinion 2:
I need 1 repository RootRepository which handles everything (BLL + DAL). The repository exposes DTO's while internally it works with the domain objects
I would like to have some perspective on these 2 points & which is really the way to go about for a repository implementation.
Thanks for all the help