Domain-Driven Design
> >
ValueObjects

Excerpted from DomainDrivenDesignBook

Definition: A Value Object is an object that describes some characteristic or attribute but carries no concept of identity.

Problem:
Tracking the identity of Entities is essential, but attaching identity to other objects can hurt system performance, add analytical work, and muddle the model by making all objects look the same.

Software design is a constant battle with complexity. We must make distinctions so that special handling is applied only where necessary.

However, if we think of this category of object as just the absence of identity, we haven?t added much to our toolbox or vocabulary. In fact, these objects have characteristics of their own and their own significance to the model. These are the objects that describe things.

Solution: When you care only about the attributes of an element of the model, classify it as a ValueObject. Make it express the meaning of the attributes it conveys and give it related functionality. Treat the ValueObject as immutable. Don't give it any identity and avoid the design complexities necessary to maintain Entities.

See also: ValueObject

ValueObjects is mentioned on: ValueObject | Specification | MessagesByTopic | SideEffectFreeFunctions | Repositories | Aggregates | RepresentingTheDomainInXSD | TerminologyQuestionOnValueObjectsAndEntities | ChoosingBetweenEntityAndValueObjects



VeryQuickWiki Version 2.6.3 - HTML Export