Value Object

Object wrapping a value.

A value object is an object wrapping a value to treat it like an object instead of a primitive. It's often used in combination with the Always Valid to validate the wrapped value.

Value objects are Immutable. Two value objects carrying the same value are equivalent, they have no concept of identity.

They often contain computations such as sums, differences, comparisons and so on.

Last updated