Value Object Block
A value object describes a concept by its values rather than by a separate identity.
When To Use It
Use a Value Object block for concepts such as Money, Email Address, Postal Address, Date Range, Quantity, Percentage, Geo Coordinate, Measurement, or Tax Rate. Value objects make rules clearer and reduce primitive fields scattered across the model.
Required Data
- Name: descriptive concept name.
- Fields: component values, such as amount and currency for Money.
- Validation: rules for valid values.
- Used by: aggregates, entities, commands, events, and read models that reference it.
Recommended Data
- Formatting: how the value appears to users.
- Comparison rule: how equality or ordering works.
- Conversion rule: units, currencies, time zones, or locale handling.
- Privacy classification: useful for email, phone, address, and personal data.
Examples
- Money: amount, currency, rounding rule.
- Appointment Window: start time, end time, time zone.
- Delivery Address: street, locality, region, postal code, country.
- Risk Score: score, band, calculated date.