👨‍💻
Software Engineering
Implementing Domain Driven Design
Implementing Domain Driven Design
  • Intro
  • 1. Getting Started with DDD
    • The Business Value of DDD
  • 4: Architecture
  • 5: Entities
    • Why We Use Entities
    • Unique Identity
  • 6: Value Objects
    • Value Object Characteristics
    • Integrate with Minimalism
    • Standard Types Expressed as Values
    • Resources
  • 10: Aggregates
  • 8: Domain Events
    • The When & Why of Domain Events
    • Modeling Events
    • Publishing Events from the Domain Model
  • 13: Factories
  • Resources
Powered by GitBook
On this page
  • Advantages
  • How do we determine if a domain concept should be a Value Object?

6: Value Objects

Often overshadowed by Entity-Think, Value Objects are a vital building block of DDD

Value types that measure, quantify, or describe things are easier to create, test, use, optimize, and maintain

Advantages

Value Types that measure, quantify, or describe things are easier to create, test, use, optimize, and maintain.

We should strive to model using Value Objects instead of Entities wherever possible.

Entity design should be biased towards serving as a Value container rather than a child Entity container.

How do we determine if a domain concept should be a Value Object?

When we care only about the attributes of an element in the model, classify it as a value object. Make it express the meaning of the attributes it conveys and give it related functionality. Treat the Value Object as immutable. Don't give it any identity and avoid the design complexities necessary to maintain Entities. [- Evans, p. 99]

PreviousUnique IdentityNextValue Object Characteristics

Last updated 7 months ago