> [!note] Disclaimer
> This note has been replaced by a more detailed blog post, [Understanding Value Object](https://adrianodigiovanni.com/understanding-value-object). The post offers expanded insights and examples on the concepts mentioned here. For the latest information, please check the blog.
A Value Object is identified[^1] by its content, meaning its *uniqueness* comes from the content itself, and *sameness* is determined by comparing that content through [[Value equality]].
For example, a number is identified by its value, and altering it results in a different number. Similarly, money is defined by its amount and currency.
Since changing the content of a Value Object results in a different Value Object, they are implemented as immutable.
In essence, Value Objects represent immutable conceptual wholes[^2] identified by their content.
Money, for instance, is a conceptual whole defined by its amount and currency.
Value Objects help address validation and duplication issues that arise from using primitive data types[^3] to represent domain concepts. They encapsulate the values to describe a concept, its invariants, and business rules.
Because Value Objects are immutable, they cannot represent mutable domain concepts. Instead, they typically describe or quantify mutable concepts.
For instance, attributes like name or height are best represented as Value Objects that describe and quantify a person.
Value Objects provide [[Referential transparency]], meaning their operations are deterministic and produce [[Side-Effect-Free Behavior]].
The simplicity and immutability of Value Objects make them easy to create, test, use, optimize, and maintain. When appropriate, prefer modeling domain concepts as Value Objects.
[[Value Objects should not depend on or reference Entities]].
![[Quotes#^a5b844]]
[^1]: [[Identity is about defining uniqueness and sameness]]
[^2]: [[Whole Value]]
[^3]: [[Primitive Obsession]]