I’ve had a look around at different examples online. I’ve seen written in a lot of places that repositories are only used in DDD for the persistence of aggregate roots. Yet on DDDSample.Net, there seems to be repositories in the persistence layer for persisting non-aggregate single entities.
This is what I expected to find, so am I right in thinking that repositories are not only reserved in DDD for only persisting aggregate roots?
Cheers,
Adrian
Repositories in domain-driven design are about aggregates. Entities are accessed via their aggregate root. There is also Fowler’s definition of the respository pattern, which is about “domain objects”.