Stack Explorer

Repository Pattern

data

Abstraction over the data access layer

Type: pattern

Principles

Abstracts persistenceCollection interfaceDomain does not know DB

When to use

Separate domain from persistence, important testing, multiple data sources

When not to use

Very simple apps, when ORM is sufficient

Pros and Cons

Ventajas

  • + Testing without DB
  • + Easy to change DB
  • + Centralizes queries

Desventajas

  • - Additional abstraction
  • - Can hide performance issues

Related Technologies

Related Patterns