You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/building-blocks/rules/value-object.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,12 @@ Classes with static methods encapsulating domain logic and correlated utilities
13
13
14
14
- All methods are static — value objects are namespaces with type safety, not instances with state.
15
15
- Group by concept, not by operation type. `Price.format()`, `Price.isValid()`, `Price.fromCents()` — not a `formatters.ts` file with `formatPrice`, `formatDate`, `formatName`.
16
-
-Can be also defined for domain concepts, for e-commerce for instance `Product.getRating()`.
16
+
-For domain computations, the value object belongs to the feature that owns the result. Cart total → `Cart.calculateTotal(items)`, not a loose `calculateCartTotal` utility.
0 commit comments