website refactor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user