jargon

Design patterns·Objects and the database between them

the code asks for the customer as if from an in-memory collection, and where it actually came from is somewhere else.

Repository pattern

Also calledrepository, collection-like store

An abstraction that presents stored aggregates as though they were a collection, so domain code queries objects rather than rows. It is a domain-driven design idea: one repository per aggregate root, with methods named in the language of the domain, not one per table. That is the real difference from a DAO — a repository is defined by the model it serves, a DAO by the storage it wraps — and it is lost the moment a repository grows a method per query the UI happens to need.

Commonly confused with