Software Design

Entities vs Value Objects: The Core Distinction

UML Class Diagrams · made in Skemio

UML class diagram contrasting the Customer Entity with unique ID against the Money and Address immutable Value Objects.
UML class diagram contrasting the Customer Entity with unique ID against the Money and Address immutable Value Objects.

What it shows

  • Entities are distinguished by mutable life cycles and unique identifiers
  • Value Objects are immutable and defined purely by structural equality
  • Replacing primitives with Value Objects eliminates invalid domain states

The takeaway

Use Entities when identity matters over time; use Value Objects for immutable descriptive attributes.

More uml class diagrams