The Transparency of Value Objects

Rafael A. George Duval
1 min readAug 6, 2022

Objects that are equal due to the value of their properties are called value objects.

Values should be easy to construct; therefore, every programming language provides a mechanism to build values straightforwardly.

Value objects are immutable. Values are language-agnostic

For example, building an integer from a string in Ruby looks like the following:

Every single primitive type is a value. Thus, values should expose their meaning in a system’s context.

Values expose meaning

Values in a system can be used to measure things because they represent meaning. Thus, they need to compare with each other.

Objects that are equal due to the value of their properties are called value objects.[¹]

Values should be transferable.

In general, values in your system afford shifting boundaries between anything.

--

--