business-logic-entry-point-use-repositories
Use Repositories in Business Logic Entry Points
Goal
Every business-logic entry point that persists, retrieves, or deletes domain entities must do so exclusively through repositories.
A repository is an abstraction that encapsulates the persistence and retrieval of domain entities. It exposes operations expressed in domain terms — such as create, update, find, delete — and hides the underlying persistence technology.
Business-logic entry points must not call the project's ORM, database library, framework persistence API, query builder, or any other persistence technology directly. All creation, reading, updating, and deletion of domain entities must go through a repository.
This rule applies regardless of the persistence technology in use: relational databases, document stores, key-value stores, object stores, or any other storage mechanism.
What Counts as In Scope
Apply this skill to code that does one or more of these things: