Package org.jmolecules.ddd.types
Interface Repository<T extends AggregateRoot<T,ID>,ID extends Identifier>
-
public interface Repository<T extends AggregateRoot<T,ID>,ID extends Identifier>
Identifies aRepository
. Repositories simulate a collection of aggregates to which aggregate instances can be added and removed. They usually also expose API to select a subset of aggregates matching certain criteria. Access to projections of an aggregate might be provided as well but also via a dedicated separate abstraction.Implementations use a dedicated persistence mechanism appropriate to the data structure and query requirements at hand. However, they should make sure that no persistence mechanism specific APIs leak into client code.
- Since:
- 1.2
- See Also:
AggregateRoot
, Domain-Driven Design Reference (Evans) - Repositories