Skip to main content

Repository (Software Design)

A Repository provides an interface for persisting and retrieving data, while hiding the implementation details of the underlying infrastructure responsible for carrying out such operations, e.g. database access mechanisms.

Repositories are considered particularly important in Domain Driven Design, where the interface of a Repository "communicate(s) design decisions about object access" and "decouple(s) application and domain design from persistence technology". [DDD]

"A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection." [PoEAA]