I have an entity that is called Master which is composed of a number of Slave entities.
There can only be one Master in my database and I want to query repositories to get the Slave for a given id.
I initially created a SlaveRepository and queried that by id. That seems fine and works and other developers could use my repository.
Then I thought about aggregate roots and created a MasterRepository and returned the Master and then did a loop on that to get the required Slave entity. The problem I felt here is once I expose this to other developers they would have to do the same, so I through about having a method on the MasterRepository called GetSlaveByID(string id) and then I could get the Slave directly (hides the loop functionality).
Now, should my repository return a Slave even though it is called a MasterRepository? And more importantly which is the right way to go?
I am in the early stages of trying to apply DDD and TDD so there are probably lots of things I need to think about before deciding which is the correct way I guess.