Show in graph

Software → Software Design

Value Object

An immutable domain object defined by its attributes rather than a persistent identity.

Motivation

A Value Object makes domain values explicit and places validation and behaviour beside the data they govern.

Examples

Money, address, date range, coordinates, and measurement may be modeled as value objects.

Common mistakes

  • Adding an artificial identifier.
  • Making value objects mutable.
  • Using primitive strings and numbers where domain constraints matter.