Repository (design pattern)

A repository is a design pattern used in software engineering. It sits between the domain layer and the data access layer. It defines an interface for getting domain specific entities from the data access layer.  To the domain layer, the repository will provide lists of domain objects; these lists are independent of how the domain objects are stored, they might be provided by a database, or they might be obtained through a web service.  The domain layer has the possibility to get domain-specific objects or entities from the data access layer, independently of how these entities are stored. Using the repository, domain objects can be fetched using certain criteria, they can be added or removed. The repository's task is to fetch, store or delete then. The details of how this is done are not exposed to the domain layer.

Category:Design patterns