Entity (Domain-Driven Design)

An entity in Domain-Driven Design is a model object defined by an identity that lasts while its attributes change, such as one health economic model run.

Status
Published, version 1.0.1
Last reviewed
17 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Entity (Domain-Driven Design) and Identity in Health Economic Models

In Domain-Driven Design (DDD), calling an object an entity is a decision that it must be told apart by who or what it is, even when another object carries exactly the same description. Health economic work is full of such objects. Two model runs with identical settings are still two runs, and a simulated patient stays the same person while age, health state and accumulated costs change with every cycle. Giving these objects a stated rule for sameness allows each reported result to be traced to the run, model version and inputs behind it, once every result records their identifiers.

Where the term comes from and who uses it

The DDD sense of the term comes from software design and is new to health economics, although the word itself also names database tables and the units that flow through a discrete event simulation. Eric Evans set out the DDD sense in his 2003 book on Domain-Driven Design, where chapter 5, A Model Expressed in Software, treats entities, also known as reference objects, beside value objects and services. The wiki label carries a qualifier because the word has other senses on the wiki.

  • Evans's free 2015 reference describes entities as objects that represent "a thread of continuity and identity, going through a lifecycle, though their attributes may change", and ends the pattern with the rule that the model must define what it means to be the same thing.
  • Martin Fowler, summarising what he calls the Evans Classification, describes entities as objects with a distinct identity that runs through time and different representations, in contrast to value objects, which matter only as the combination of their attributes.
  • Microsoft's guide to designing a microservice domain model treats entities as defined primarily by identity, continuity and persistence over time.

None of the health economics sources cited here uses the DDD term. The Model Execution examples are the wiki's own application, drawn up for its Domain Layer and not yet tested with practitioners.

What makes an object an entity

Evans's pattern turns on two ways in which matching by description fails. An entity may have to be matched with another representation of itself whose attributes differ, and it must be kept apart from other objects whose attributes are the same. He warns that mistaken identity can lead to data corruption. The response is to keep the definition of an entity focused on its lifecycle and identity, and to give it an operation guaranteed to produce a unique result for each object, for example a symbol that is guaranteed unique.

The identifier may come from outside the system or be created by it, but Evans requires that it correspond to the identity distinctions in the model. Fowler notes that entities tend to be large things such as a customer, and values small things such as a date or an amount of money, compared by their contents. An amount of GBP 150 at 2025 prices, entered as a unit cost, is therefore a value, interchangeable with any other GBP 150 at 2025 prices, while a model run is an entity.

Entities in a Model Execution context

The wiki's domain model for a candidate Model Execution context, a bounded context for turning a specified model and a set of inputs into stored results, shows which objects need an identity. The test is whether two objects with the same contents could still be different things. The table gives the wiki's illustrative answers.

ElementEntity or valueWhat makes it the same thing
Model RunEntity, root of its aggregateA run identifier issued when the run is created
Model SpecificationEntityIts name and model version
Result SetEntity, root of its own aggregateIts own identifier, with a reference to the run that produced it
Simulated individualEntity inside a patient-level runAn individual index, with its own random number seed where the model sets one per person
Parameter ValueValue objectNothing beyond its amount and unit and, for costs, currency and price year
Parameter SetA choice to settleA name tracked through revisions, or only its contents for one sampled draw

In a three-state Markov cohort model with the states Well, Sick and Dead, the cohort itself carries no individual identities. State occupancy at each cycle is a set of numbers, so the cohort trace holds values, while the Model Run that produced it is an entity. The domain model's rule that every reported Result Set names the model version and parameter set behind it depends on those identities staying stable. The Parameter Set row needs a decision recorded in the ubiquitous language, because the domain model page lists it as an entity while the sibling Value Object page treats the input values each version holds as a value object.

Simulated patients as entities

Patient-level models give the clearest health economic case. In an individual patient simulation, Krijkamp and colleagues describe setting a random number seed per individual so that the same hypothetical individual is exposed to both the intervention and the control, sharing the same baseline characteristics across scenarios. On the wiki's reading, this fits Evans's case of an object matched with another representation of itself, since the person's later health states and costs differ between the arms while the person stays the same.

The discrete event simulation literature also calls simulated patients entities. Zhang's 2018 systematic review says patients or care providers are typically referred to as entities that go through the simulated process, with attributes such as age, sex and health status that can be updated as the model runs. That modelling sense, covered on the wiki's Entity Definition page, concerns the units that flow through a simulation. The DDD sense classifies any object in a domain model by whether identity defines it, so a model specification is an entity although nothing flows through a simulation.

Worked example with paired individuals in two strategies

All numbers in this example are illustrative. The three-state model is run as a microsimulation with four simulated individuals, far fewer than any real analysis would use, under usual care and under a new treatment. Individuals 1 and 2 are aged 65 or over and individuals 3 and 4 are younger. Their discounted QALYs are 5.0, 7.0, 6.0 and 8.0 under usual care and 5.6, 7.5, 6.2 and 8.1 under treatment.

ΔEˉ=1N∑i=1N(EiT−EiC)\Delta \bar{E} = \frac{1}{N} \sum_{i=1}^{N} \left( E_i^{T} - E_i^{C} \right)

where ΔEˉ\Delta \bar{E} is the mean incremental QALYs per individual, NN is the number of simulated individuals, EiTE_i^{T} is the QALYs of individual ii under treatment and EiCE_i^{C} is the QALYs of the same individual under usual care.

Paired by identity, the differences are 0.6, 0.5, 0.2 and 0.1 (5.6 minus 5.0, 7.5 minus 7.0, 6.2 minus 6.0 and 8.1 minus 8.0). They sum to 1.4, so the mean gain is 1.4 divided by 4, which is 0.35 QALYs. The older subgroup gains 1.1 divided by 2, which is 0.55 QALYs, and the younger subgroup gains 0.3 divided by 2, which is 0.15 QALYs.

Suppose the treatment results were sorted by QALYs, highest first, and then joined by row position to the usual care results, which keep each row's age group. The pairs become 8.1 with 5.0, 7.5 with 7.0, 6.2 with 6.0 and 5.6 with 8.0, giving 3.1, 0.5, 0.2 and minus 2.4. These still sum to 1.4, so the mean stays at 0.35 QALYs and the headline result hides the error. The older subgroup now appears to gain 3.6 divided by 2, which is 1.8 QALYs, and the younger subgroup appears to lose 2.2 divided by 2, which is 1.1 QALYs. A join on each individual's identifier restores the correct 0.55 and 0.15, which is why the simulated individual is best modelled as an entity with a unique identifier.

Choosing what carries an identity

Identity has a cost, and Evans argues against attaching it everywhere, since giving identity to objects that do not need it can slow a system and muddle the model by making all objects look the same. What counts as the same run is one rule to state. A rerun with the same model version, inputs and seed should reproduce the earlier results, which supports reproducibility, yet it is a new Model Run with its own identifier, and matching the two by their settings would hide that the check took place. What counts as the same model is another, since a changed input value can be treated as a new run of one version or as a new version.

Identity across contexts is a third. Microsoft's guide notes that the same identity can be modelled in several bounded contexts while each context's entity keeps only the attributes its own work needs. A submitted model version could therefore keep one identifier in Model Execution and in an HTA Appraisal context, with committee status held only on the appraisal side.

Where entities meet HTA practice

Health technology assessment already depends on telling versions apart. The NICE manual (PMG36), at section 5.5.15, says a company submitting a fully executable model must give NICE full access to the programming code and should ensure that the submitted versions of the model and the written evidence submission match. A rule that every Result Set carries the identifiers of its Model Run and Model Specification shows which run and model version produced each reported number, which is the information a reviewer needs to check that match. The manual does not mention DDD, and the link is the wiki's reading. An executable model passed between company, external assessment group and committee is easier to track when its identity is explicit.

Boundaries with nearby ideas

Entity and value object are the two halves of Evans's classification. A value object is described only by its attributes and treated as immutable, so changing a value means replacing it, while an entity keeps its identity through change. An aggregate in DDD is a consistency boundary that groups entities and value objects under one root entity. Outside objects may hold references only to the root, and the rules for the group are enforced by that root or a designated framework mechanism. The Model Run is that root in the Model Execution example, so a simulated individual inside a run is reached through the run.

Entity resolution, the task of finding health data records that refer to the same patient or study and linking them, is close in spirit, since it rebuilds identity after the fact for records never given a shared identifier. The database sense is wider still. Fowler warns that entity is often used for a database table or an object corresponding to one, so a column of row numbers in a spreadsheet does not make an object an entity in the DDD sense.

Common misreadings

Three misreadings are likely when health economists first apply the pattern. Each weakens the link between a reported result and the objects that produced it.

  1. Treating every table row as an entity. Vernon's 2013 summary of his chapter on entities describes a project team that leaned too heavily on entities and overlooked value objects, and links that overuse to the undue influence of databases and persistence frameworks. Costs and utilities in a parameter table are usually values.
  2. Identifying an object by its current attributes. Evans asks designers to be alert to requirements that call for matching objects by attributes. Labelling a run only by its date and scenario name, or pairing patients by row position as in the worked example, lets two different things share a description.
  3. Giving entities data but no behaviour. Microsoft's guide says a domain entity must implement the behaviour related to its data, with its methods taking care of its invariants and rules. A Model Run that only stores fields, with every check in a separate macro, is what the guide calls an anemic domain model, a possible anti-pattern where business rules are complex. This does not conflict with Evans's advice to keep an entity's definition focused on identity, since related rules can also sit in value objects or domain services inside the same domain model rather than in code outside it.

Sources

Library

Publications

6
  • Book

    Implementing Domain-Driven Design — Vernon V, 2013 (Addison-Wesley)

    Book or book chapter listed in the Sources of the HealthEconomics.wiki Concept Architecture articles on Core Domain, Context Map, Shared Kernel, Entity (Domain-Driven Design), Invariant (Domain-Driven Design), Published Language, Domain Event and Open Host Service, where it is cited as a reference for these concepts.

  • Journal article

    Application of discrete event simulation in health care: a systematic review — Zhang X, Vol. 18, Article 687 ed., 2018 (BMC Health Services Research)

    Journal article listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Entity (Domain-Driven Design), where it is cited as a reference for that concept.

  • Other

    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.

  • Other

    Design a microservice domain model — Microsoft, In .NET Microservices Architecture for Containerized .NET Applications, updated 28 April 2026 ed., 2020 (Microsoft Learn)

    Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Entity (Domain-Driven Design), where it is cited as a reference for that concept.

  • Other

    EvansClassification — Fowler M, 2005 (martinfowler.com bliki)

    Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Entity (Domain-Driven Design), where it is cited as a reference for that concept.

  • Book

    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.

Frequently Asked Questions (6)

  • What is Entity?

    An entity in Domain-Driven Design is a model object defined by an identity that lasts while its attributes change, such as one health economic model run.

    Source: Evans 2015

  • Where does the term Entity (Domain-Driven Design) come from?

    The DDD sense of entity comes from software design and is new to health economics, although the word itself also names database tables and the units that flow through a discrete event simulation. Eric Evans set out the DDD sense in his 2003 book on Domain-Driven Design, where entities, also known as reference objects, sit beside value objects and services. His free 2015 reference describes entities as objects with a thread of continuity and identity that go through a lifecycle while their attributes change. The wiki adds the qualifier to the name because the word has other senses on the wiki.

    Source: Evans 2015

  • How does Entity (Domain-Driven Design) differ from an entity in discrete event simulation?

    In discrete event simulation, patients or care providers are usually called entities, the units that go through the simulated process with attributes such as age, sex and health status that are updated as the model runs. Zhang's 2018 systematic review of discrete event simulation in health care describes this modelling sense, which the wiki covers on its Entity Definition page. Entity (Domain-Driven Design) is a wider classification of any object in a domain model by whether identity defines it. A model specification is therefore an entity in the DDD sense although nothing flows through a simulation, and a simulated patient can be an entity in both senses.

    Source: Zhang 2018

  • Why should simulated patients be treated as an Entity (Domain-Driven Design) in a microsimulation?

    Krijkamp and colleagues set a random number seed per individual so that the same hypothetical person is exposed to both the intervention and the control with the same baseline characteristics. The person's later health states and costs differ between the arms, yet the comparison must pair the same individual, which fits the case Evans describes of an object that must be matched with another representation of itself. In the wiki's illustrative four-person example, joining sorted treatment results to usual care by row position leaves the mean gain at 0.35 QALYs but turns subgroup gains of 0.55 and 0.15 into 1.8 and a loss of 1.1. A join on each individual's identifier avoids that error.

    Source: Krijkamp et al. 2018

  • Why does Entity (Domain-Driven Design) matter for model submissions in health technology assessment?

    The NICE manual PMG36, at section 5.5.15, says a company submitting a fully executable model must give NICE full access to the programming code and should ensure that the submitted versions of the model and the written evidence submission match. Treating the Model Run, the Model Specification and each Result Set as entities with stable identifiers lets every reported result carry the identifiers of the run and model version behind it, which is the information a reviewer needs to check that match. The manual does not mention Domain-Driven Design, and the link is the wiki's own reading. A rerun with the same inputs and seed still counts as a new run with its own identifier.

    Source: NICE PMG36 (2022, updated 2026)

  • What are common mistakes when applying Entity (Domain-Driven Design) to health economic models?

    One mistake is to give an entity data but no behaviour. Microsoft's guide to designing a microservice domain model says a domain entity must implement the behaviour related to its data, and it calls a model without that behaviour an anemic domain model, a possible anti-pattern where business rules are complex. A Model Run that only stores fields while every check sits in a separate macro fits that description. Another mistake is to expect one entity to carry every attribute in every context, whereas the guide notes that each bounded context keeps only the attributes its own work needs, so committee status for a submitted model version belongs on the appraisal side.

    Source: Microsoft 2026

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

Term code
HS-HP-DH-120

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/entity-domain-driven-design