Concept Architecture
Value Object in Domain-Driven Design
In Domain-Driven Design (DDD), a value object is the kind of model element that describes a quantity or characteristic and matters only for what it says, so two value objects with the same attributes can stand in for each other. Much of the input to a health economic model has this character, because a unit cost recorded with its currency and price year, a probability per cycle or a time horizon in years is fully described by its contents. Treating such inputs as value objects keeps the unit, currency or price year attached to each number and gives each kind of value its own checks, which makes errors such as adding a 2021 cost to a 2024 cost harder to commit. The word value refers to equality by value, so the name does not mean a monetary value, value for money or a utility value, even though a cost can be one kind of value object.
Where the term comes from and who uses it
The term has its origin in software design and is new to health economics. Two authors fix its meaning, and the wiki label matches theirs.
- Eric Evans places value objects in chapter 5, "A Model Expressed in Software", of his 2003 book on DDD, beside entities and services. His free 2015 reference summarises the pattern as the way to model elements for which only the attributes and logic matter and which have no conceptual identity.
- Martin Fowler listed Value Object in his 2003 catalogue of enterprise application patterns as a small simple object, like money or a date range, whose equality is not based on identity. In a 2016 article he contrasts value objects with reference objects and treats DDD entities as a common form of reference object.
Fowler notes that around the turn of the century some Java enterprise literature used value object for a data transfer object, a plain carrier of data between systems, and that this older sense has mostly disappeared but can still be met. None of the health economics guidance or tutorials cited here uses the term, and the Model Execution examples below are the wiki's own application, drawn up for its Domain Layer and not yet tested with practitioners.
Equality by attributes instead of identity
Evans observes that many objects have no conceptual identity and that attaching identity to them adds analytical work and muddles the model. He classifies an element as a value object when only its attributes and logic matter. Fowler states the test through equality, so two point objects that both hold the coordinates (2, 3) are treated as equal.
The contrast is with an entity, the subject of the sibling page Entity (Domain-Driven Design), which Evans defines by a thread of identity that runs through time even when its attributes change. In a Model Execution context a model run is an entity, since two runs with identical settings are still two runs. A cost of GBP 460 at 2025 prices is a value, so any two such costs are interchangeable.
The same concept can fall on either side. Fowler notes that a postal address is often best treated as a simple structure of text with value equality, while a mapping system that links addresses into a hierarchy may need references, and he concludes that different contexts lead to different solutions. The choice is therefore made within one bounded context and recorded in its ubiquitous language, not settled once for every use of a word.
Unchangeable values and functions without side effects
Evans asks that a value object be treated as immutable and that all its operations be side-effect-free functions that do not depend on any mutable state. Fowler gives the reason with an example of an aliasing bug, where one date object is shared by two variables, a change made through one variable alters the other, and a retirement date moves by accident. His rule is that value objects should be immutable, so a change creates a new object.
For a modeller, converting a cost to a later price year therefore produces a new cost object, and the source figure with its original price year survives for anyone checking the calculation. Evans adds that closure of operations, where the result has the same type as the arguments, is most often applied to value objects, as when adding two costs gives a cost.
Spreadsheet models can show the same fault. If a scenario sheet still points at the base case input cells and someone edits those cells to run the scenario, the base case results change with them, which is the aliasing bug in another form.
Candidate value objects in a Model Execution context
A Model Execution context turns a model specification and its inputs into stored results. Its domain model, described on the domain model page, could express many inputs as value objects.
| Candidate value object | Attributes | Rule it enforces |
|---|---|---|
| Cost | Amount, currency, price year | Addition only with a cost in the same currency and price year |
| Probability per cycle | Number, cycle length | Number lies between 0 and 1 |
| Duration | Quantity, time unit | Conversion to cycles states the cycle length |
| Utility weight | Number, value set used | Within the range of the value set named |
| Transition matrix | Ordered health states, probabilities | Each row sums to 1 within a stated tolerance |
Fowler argues that replacing a bare number or string with a value object makes variables more explicit and provides a natural focus for validation. The DARTH coding framework of Alarid-Escudero and colleagues already encodes the variable type in the name, with prefixes such as p for probability and c for cost, and a value object carries that information in the object itself, where the code can check it. The TECH-VER paper by Büyükkaramikli and colleagues reports a student model that scaled an adverse event lasting days to a one-week cycle without matching the time units, which overstated the utility decrement. A Duration that converts only with an explicit cycle length would have exposed that unit mismatch.
The row-sum check for a transition matrix follows the cohort tutorial by Alarid-Escudero and colleagues, which states that each row of a correctly specified matrix must sum to one. The curators' briefing of 17 November 2026 plans, but has not yet published, versioned component pages for a three-state Markov cohort model that would refer to such rules, for example that each row sums to 1 within 0.000001. Where a rule spans several objects, such as a Model Run that may start only when all its inputs are valid, the sibling pages Aggregate (Domain-Driven Design) and Invariant (Domain-Driven Design) treat the rule and the object that enforces it.
Parameter set as a value or an entity
A Parameter Set is the hardest case in the Model Execution context, because the name has two senses. In the probabilistic sensitivity analysis of the cohort tutorial, the authors sampled 1,000 parameter sets from their distributions, so each set is one draw. The values of a draw fit the value object pattern, and the identity needed to link a draw to its results comes from outside it, from the model run that evaluates it or, where one run covers the whole PSA, from the draw's iteration number within that run.
The wiki's Model Execution working notes record a second use of the name for a named, versioned collection of inputs, which the Domain Model page lists as an entity because the team tracks one named set through successive versions. The 17 November briefing requires that a published version is never edited and that a correction creates a new version, but freezing a version does not by itself make it a value, since in Fowler's account an immutable object compared by a unique number remains a reference object. On one reading the named series and its numbered versions keep identity, while the input values each version holds form a value object compared by content. The Model Execution glossary needs to record which reading it adopts, and versions of the model itself have their own model version page.
Worked example with costs in different price years
In this illustrative case a Cost value object handles two inputs from different years. A drug cost of GBP 400 comes from a 2021 source and a hospital stay of GBP 2,500 from a 2024 source, and the analysis reports at 2025 prices. The adjustment follows the method set out on the cost adjustment page.
where is the cost at the prices of source year , is the cost at the prices of target year , and and are the values of a price index for those years.
Take illustrative index values of 100.0 for 2021, 112.0 for 2024 and 115.0 for 2025.
- The drug cost becomes 400 times 115.0 divided by 100.0, which is 400 times 1.15, or GBP 460.00 at 2025 prices.
- The hospital cost becomes 2,500 times 115.0 divided by 112.0, which is 287,500 divided by 112.0, or GBP 2,566.96 at 2025 prices.
- Both costs now share currency and price year, so the Cost object allows the sum, which is 460.00 plus 2,566.96, or GBP 3,026.96.
Without the rule a careless sum of the raw figures gives 400 plus 2,500, or GBP 2,900, which understates the 2025 cost by 3,026.96 minus 2,900, or GBP 126.96. With the value object that sum cannot be formed, because adding a 2021 cost to a 2024 cost raises an error, and each adjustment returns a new Cost, so both source figures stay available for checking. The rule checks only that like is added to like and says nothing about whether the source costs or the chosen index are right.
Boundaries with nearby ideas
Several nearby ideas share words with value object but answer different questions. Two are other DDD building blocks, and the rest are health economic terms that a reader might confuse with it.
- An entity is defined by identity through time and a value object by its attributes. Many domain models use both.
- An aggregate is a consistency boundary around a cluster of entities and value objects with one root entity, and the root or a designated framework mechanism enforces the rules for the group, so a value object often sits inside an aggregate.
- A value set is the set of utility weights from a valuation study, and a utility value is a number on that scale. Either could be stored in value objects, but neither is the DDD pattern.
- A parameter input is the health economic quantity entered into a model, while a value object is one way of representing such an input in software.
Limits and common misreadings
Four misreadings are easy to make in health economic work. The first two concern what a value object is, and the last two concern what it can achieve.
- Treating a value object as data with no behaviour. Evans warns that thinking of value objects as just the absence of identity adds little, and asks that each one express the meaning of its attributes and carry related functionality. A Cost that holds an amount but cannot adjust or add itself safely misses the point.
- Deciding once for all contexts. Fowler's address example shows that one concept can be a value in one context and need identity in another. Parameter set is the local case.
- Assuming immutability is free. Fowler points out that when things do need to change, immutability can introduce complexity, so large structures that change often need care.
- Taking a well-formed value for a correct one. A Cost with the right currency and price year can still carry a wrong amount, and a valid transition matrix can still describe the disease badly. Input data validation and technical verification remain separate tasks.
Sources
- Alarid-Escudero F, Krijkamp EM, Pechlivanoglou P, et al. A need for change! A coding framework for improving transparency in decision modeling. PharmacoEconomics. 2019;37(11):1329-1339. https://doi.org/10.1007/s40273-019-00837-x
- Alarid-Escudero F, Krijkamp EM, Enns EA, et al. An introductory tutorial on cohort state-transition models in R using a cost-effectiveness analysis example. Medical Decision Making. 2023;43(1):3-20. https://pmc.ncbi.nlm.nih.gov/articles/PMC9742144/
- Büyükkaramikli NC, Rutten-van Mölken MPMH, Severens JL, Al M. TECH-VER: a verification checklist to reduce errors in models and improve their credibility. PharmacoEconomics. 2019;37(11):1391-1408. https://doi.org/10.1007/s40273-019-00844-y
- Evans E. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley; 2003. Publisher sample pages (contents). https://www.ciscopress.com/content/images/9780321125217/samplepages/0321125215.pdf
- Evans E. Domain-Driven Design Reference: Definitions and Pattern Summaries. Domain Language, Inc.; 2015. Licensed CC BY 4.0. https://www.domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf
- Fowler M. Value Object. Catalog of Patterns of Enterprise Application Architecture; 2003. https://martinfowler.com/eaaCatalog/valueObject.html
- Fowler M. ValueObject. martinfowler.com bliki; 14 November 2016. https://martinfowler.com/bliki/ValueObject.html
- Fowler M. AliasingBug. martinfowler.com bliki; 14 November 2016. https://martinfowler.com/bliki/AliasingBug.html
Related Concepts (2)
Library
Publications
5
AliasingBug — Fowler M, 2016 (martinfowler.com bliki)
Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Value Object, where it is cited as a reference for that concept.
Web (Open Access)View source →Domain-Driven Design Reference: Definitions and Pattern Summaries — Evans E, 2015 (Domain Language)
Source listed in the Sources of the HealthEconomics.wiki Concept Architecture articles on Domain-Driven Design, Domain (Domain-Driven Design), Subdomain (Domain-Driven Design), Core Domain, Bounded Context, Ubiquitous Language, Domain Model, Context Map, Strategic Design, Domain Expert, Entity (Domain-Driven Design), Value Object, Aggregate (Domain-Driven Design), Invariant (Domain-Driven Design), Anticorruption Layer, Published Language, Domain Event, Domain Service, Shared Kernel and Open Host Service, where it is cited as a reference for these concepts.
Value Object — Fowler M, 2003 (Catalog of Patterns of Enterprise Application Architecture)
Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Value Object, where it is cited as a reference for that concept.
Web (Open Access)View source →ValueObject — Fowler M, 2016 (martinfowler.com bliki)
Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Value Object, where it is cited as a reference for that concept.
Web (Open Access)View source →Domain-Driven Design: Tackling Complexity in the Heart of Software — Evans E, 2003 (Addison-Wesley)
Book or book chapter listed in the Sources of the HealthEconomics.wiki Concept Architecture articles on Domain-Driven Design, Domain (Domain-Driven Design), Core Domain, Bounded Context, Context Map, Published Language, Open Host Service, Ubiquitous Language, Domain Model, Strategic Design, Domain Expert, Entity (Domain-Driven Design), Invariant (Domain-Driven Design), Anticorruption Layer, Shared Kernel, Value Object and Domain Service, where it is cited as a reference for these concepts.
BookView source →
Frequently Asked Questions (6)
What is Value Object?
A value object is an unchangeable Domain-Driven Design object defined only by its attributes, such as a cost stated with its currency and price year.
Source: Evans 2015
Where does the term Value Object come from?
Value Object is a term from software design and is new to health economics. Eric Evans made it one of the basic building blocks of Domain-Driven Design, the modelling method he set out in a 2003 book, where it sits beside entities and services. His free 2015 reference says that value objects describe or compute some characteristic of a thing and have no conceptual identity. The wiki uses the term for its Domain Layer, which applies Domain-Driven Design to building and checking models, and none of the health economics guidance cited on the page uses it.
Source: Evans 2015
Does the word value in Value Object mean a monetary value?
The word value in Value Object refers to equality by value, so the name does not mean a monetary value or value for money. Martin Fowler describes a value object as a small simple object whose equality is not based on identity, and he gives money and a date range as examples. A cost recorded with its amount, currency and price year can therefore be one kind of value object, and a probability per cycle or a duration in years can be another. Two value objects that hold the same attributes are treated as equal and can stand in for each other.
Source: Fowler 2003
How does a Value Object differ from an Entity (Domain-Driven Design)?
An Entity (Domain-Driven Design) is defined by a thread of identity that runs through time even when its attributes change, while a Value Object matters only for the attributes and logic it carries. Evans warns that attaching identity to objects that have none adds analytical work and muddles the model. In a Model Execution context a model run is an entity, since two runs with identical settings are still two runs, whereas a cost of GBP 460 at 2025 prices is a value that any equal cost can replace. Many domain models use both kinds, and an aggregate often holds value objects under a root entity.
Source: Evans 2015
How does Domain-Driven Design ask a Value Object to behave when a value changes?
Evans asks that a Value Object be treated as immutable and that all its operations be side-effect-free functions that do not depend on any mutable state. Converting a cost to a later price year therefore produces a new cost object, and the source figure with its original price year stays available to anyone checking the calculation. Evans adds that closure of operations, where the result has the same type as the arguments, is most often applied to value objects, as when adding two costs in the same currency and price year gives another cost. Because a value object has no identity, the design also avoids the complexity of maintaining entities.
Source: Evans 2015
How could a Value Object help prevent errors in a health economic model?
A Value Object can keep a number together with its unit, so a calculation that mixes units has to state the conversion. The TECH-VER verification checklist by Büyükkaramikli and colleagues reports a student model that scaled an adverse event lasting days to a one-week cycle without matching the time units, which overstated the utility decrement. A Duration value object that converts to cycles only with an explicit cycle length would have exposed that unit mismatch. Such a rule checks only that like is combined with like, so input data validation and technical verification of the model remain separate tasks.
Source: Büyükkaramikli et al. 2019
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 17 Nov 2026
Content version: 1.0.1
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/value-object
- Term code
- HS-HP-DH-121
Stable URI · Machine-readable · Resolvable · CC BY 4.0
