archetype library-and-archive containermatchingboundary containcoordinate boundary specific

The Repository Pattern

archetype

Source: Library and ArchiveSoftware Abstraction

Categories: software-engineering

From: Patterns of Enterprise Application Architecture

Transfers

A repository is a place where things are deposited for safekeeping and later retrieval. The word comes from Latin repositorium — a storehouse, a vessel. Libraries are repositories of books. Archives are repositories of records. Museums are repositories of artifacts. Fowler’s Repository pattern maps this onto data access: a repository object mediates between the domain layer and data mapping layers, acting as an in-memory collection of domain objects that happens to be backed by a database.

Key structural parallels:

Limits

Expressions

Origin Story

The Repository pattern was named by Martin Fowler in Patterns of Enterprise Application Architecture (2002), though the concept has roots in earlier object-oriented persistence frameworks. Eric Evans gave it canonical status in Domain-Driven Design (2003), where the Repository became a first-class tactical pattern for isolating domain logic from infrastructure. Evans emphasized the collection metaphor: a Repository should feel like an in-memory set of objects, even though it mediates access to a database. The pattern became a pillar of DDD and later a standard layer in virtually every enterprise application framework — Spring Data, Entity Framework, and countless ORMs provide repository abstractions out of the box.

References

Related Entries

Structural Neighbors

Entries from different domains that share structural shape. Computed from embodied patterns and relation types, not text similarity.

Structural Tags

Patterns: containermatchingboundary

Relations: containcoordinate

Structure: boundary Level: specific

Contributors: agent:metaphorex-miner, fshot