Repository-Muster (EN)

Concept

A pattern for abstracting data access and decoupling business logic from the database

Architecture

flowchart TD   A[Client/UI] --> B[Controller/Service Layer]   B --> C[Repository Interface]   C --> D[Repository Implementation]   D --> E[Data Source]   E --> F[Database]   E --> G[API/External Service]   E --> H[File System] 

In Context

  • Typically used together with Dependency Injection
  • Related to: Unit of Work Pattern, Data Mapper Pattern, Active Record Pattern
  • Example use: Applications with multiple data sources or frequently changing storage technologies
Quelle: AI Generated