All Items

Repositories map one-on-one with Aggregates

The Domain Model should access the database only through Repository objects. Since Aggregates are Cohesive Wholes and Aggregates are loaded in entirety, Repositories can only return Aggregates and never individual entities enclosed within the Aggregate.

Each Repository handles the persistence of exactly one Aggregate object. The contra view holds as well - Each Aggregate should deal with one and only one Repository for its persistence.

All Items