repository-pattern
Installation
SKILL.md
Repository Pattern
When to use
- The user wants domain code to save and load aggregates through an interface instead of writing SQL or ORM calls inline.
- The user needs to change the data store or query technology without touching the code that uses the data.
- The user wants to test business logic against an in-memory repository instead of a real database.
When NOT to use
- Do not wrap ad-hoc reporting or analytics queries that return raw rows in a repository when there is no aggregate to reconstitute.
- Do not add repositories to a small CRUD app that deliberately uses active-record models and has no separate domain layer.