Skip to content

Repository

Stable ID: pattern.repository
Kind: design-pattern
Status: stable
Source: skill/references/design-patterns/repository.md

Purpose

Expose persistence operations in domain terms while isolating storage protocols and mapping.

Use when

  • Domain logic needs a stable persistence port.
  • Storage implementations or test substitutes vary.

Avoid when

  • The abstraction mirrors tables or generic CRUD without domain meaning.
  • A one-off data script has no durable domain boundary.

Applicability

  • Languages: any, python, q-kdbplus, cpp, rust, dart-flutter, typescript
  • Related entries: component.data-access, decision.repository-vs-adapter