In a Layered Architecture with Dependency Inversion Principle we have some Application Services (in Application Layer) and some Domain Services (in Domain Layer).
Now I want to do some validations on Object Compositions. In the red book, on chapter 5 under Validating Object Compositions somewhere it says:
But it may be best to manage that kind of validation using a Domain Service. The Domain Service can use Repositories to read the Aggregate instances it needs to validate.
- Doesn't this means that repository interfaces live in domain layer?
- If yes, are there any un-told truth about these repository interfaces? (maybe they can only fetch aggregates by id?)
I know that this question has been asked so many times. But I find most of the answers neglecting the blue and the red book this stackexchange thread for example