docs: define repository pattern boundary

This commit is contained in:
AzuTear
2026-06-28 09:48:34 +02:00
parent ed8efda692
commit 170308ba05
8 changed files with 171 additions and 2 deletions
+22
View File
@@ -97,6 +97,28 @@ Domain code should not depend on delivery mechanisms, databases, network
clients, or framework-specific runtime concerns unless the project intentionally
uses an architecture where that trade-off is accepted and recorded.
## Persistence Boundary
The default persistence boundary is the repository pattern.
Use repositories to express domain-specific persistence operations without
leaking database, ORM, file-system, or external storage details into application
or domain logic.
Default rules:
- Application or domain-facing code depends on repository interfaces.
- Infrastructure implements repository interfaces.
- Repositories are named around domain concepts, not database tables.
- Repositories expose intention-revealing operations, not generic CRUD by
default.
- Transaction boundaries are explicit at the application service, unit of work,
or framework boundary selected by the project.
If a project intentionally avoids repositories because the framework or
architecture provides a better persistence boundary, record that decision in
[DECISIONS.md](DECISIONS.md).
## Request Flow
```mermaid