website refactor

This commit is contained in:
2026-01-18 23:55:26 +01:00
parent c0559d8b48
commit c78b17eb58
4 changed files with 75 additions and 14 deletions

View File

@@ -93,9 +93,19 @@ Value Objects MUST NOT:
• contain business workflows
• reference entities
• perform IO
**contain presentation or formatting logic** (e.g., `formatForDisplay()`)
### Domain vs. Presentation Value Objects
It is critical to distinguish between **Domain Value Objects** and **Presentation Value Objects** (Displays):
- **Domain Value Objects (Core):** Protect business meaning and invariants. They are pure and know nothing about how data is shown to users.
- **Display Objects (Website):** Protect presentation logic and formatting. They are used by the Website (both server and client) to ensure consistent display.
If the API needs to return formatted strings, this logic belongs in **API Presenters**, not in Domain Value Objects.
Creation Rules
• create() for new domain meaning
• fromX() for interpreting external formats