Domain Event

A domain event in Domain-Driven Design is a record that something domain experts care about has happened, such as a health economic model run completing.

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

Domain Event in Health Economic Modelling

In Domain-Driven Design (DDD), a domain event is an object in the domain model that states that something happened which the people who know the subject want to track, such as a model run finishing or a parameter set being approved. In the wiki's Domain Layer, which applies DDD to health economics practice, domain events record the history of work around a health economic model, so that a reviewer can trace why a reported result changed between versions. A domain event in this sense describes the modelling work and is a different thing from a clinical event such as a stroke inside a simulated patient's history.

Where the term comes from and who uses it

Domain event is a term from software design, new to health economics and a later addition to DDD. The wiki label matches the term these sources use.

  • Eric Evans, in his free 2015 reference, lists Domain Events among the building blocks of a model-driven design, marked as a term introduced since his original book, and sums the pattern up as something that happened that domain experts care about.
  • Vaughn Vernon gives a chapter of Implementing Domain-Driven Design (2013) to domain events and states that Evans did not formally introduce them as part of DDD until after his book was published. Evans's foreword to that book says it places domain events alongside entities and value objects as building blocks of a model.
  • Martin Fowler drafted a Domain Event pattern in 2005, describing it as capturing the memory of something interesting which affects the domain.

None of the health economics sources read for this page, including the NICE manual (PMG36) and the TECH-VER checklist, uses the term. The Model Execution and HTA Appraisal examples below are the wiki's own application and have not been tested with practitioners.

What a domain event records

Evans starts from a gap in the other building blocks. An entity tracks its current state and the rules of its lifecycle, but the causes of each change are usually not explicit, so it may be hard to explain how the system came to be as it is. Audit trails allow tracing but seldom suit the logic of the software, and change histories keep earlier states while ignoring what the changes meant. A related problem arises in distributed systems, where aggregates are kept internally consistent while other changes travel asynchronously and can arrive out of order or from different sources.

His remedy is to model activity in the domain as a series of discrete events and to represent each event as a domain object. Such an event is a full part of the domain model, distinct from system events about the software itself, although a system event is often linked to a domain event, either as a response to it or as the way its information reaches the software. Evans asks modellers to ignore irrelevant activity and make explicit the events that domain experts want to track or be notified of, or that go with state changes in other model objects. In a distributed system, the state of an entity can then be inferred from the domain events that one node currently holds. In his account an event is ordinarily immutable, as a record of something in the past. Besides a description, it typically holds a timestamp for when the event occurred and the identities of the entities involved, and often a second timestamp for when it was entered and who entered it. An identity built from these properties lets two copies of the same event be recognised as one.

Fowler's draft makes the two times concrete with a card payment made on a Tuesday but transmitted only on the Friday, and warns against storing one time without saying which. He keeps the source data of an event unchanged and corrects a mistaken event with a further one, which he calls a retroactive event.

Names come from the ubiquitous language of the bounded context. Microsoft's guidance on DDD for .NET microservices advises naming each event class as a past-tense verb, as in OrderShippedDomainEvent, because an event is something that has already happened.

Domain events in a Model Execution context

The Domain Layer's first working example is a Model Execution context, whose job is to turn a specified model and a set of inputs into stored results. A model run in that context can be treated as an aggregate whose root checks the rules on its inputs before the run starts. Evans applies consistency rules synchronously within an aggregate boundary and handles updates across boundaries asynchronously, and Vernon notes that when an event results from a command on an aggregate, the aggregate itself publishes it. Domain events can then tell the rest of the work what a run did, without other objects reaching inside the run.

The table lists candidate events for this context and one from an HTA Appraisal context. The names and contents are the wiki's illustrative proposals.

Candidate eventWhat it would record
Parameter Set ApprovedParameter set identifier and version, approver, date approved
Parameter Set RevisedNew parameter set identifier, the set it replaces, what changed, date occurred and date entered
Model Run RefusedRun identifier, the rule that failed, the inputs checked
Model Run CompletedRun identifier, model version, parameter set, seed if stochastic, time finished
Model Version ReleasedVersion number, date, changes since the previous release
Updated Economic Model RequestedAppraisal, request date, what was asked for

The last row rests on the NICE manual (PMG36), whose section 5.8.53 allows NICE, when a committee cannot make recommendations without further evidence, to request specific information, further analyses or an updated economic model. That request is a dated occurrence an event could record, in a NICE-specific context, not HTA in general. Smith and colleagues describe a living HTA pipeline in which the analysis runs at set times, such as monthly, or when triggered by an event such as an update to the underlying data or model code. Their paper does not use DDD terms, yet a data update that starts a rerun is close to what DDD would model as a domain event.

Worked example with an illustrative event log behind a changed ICER

The example below uses an illustrative three-state cohort Markov model with the states Well, Sick and Dead, used to compare a new treatment with usual care. All numbers below are hypothetical, and a parameter set here means a named, versioned input file, not one draw of a probabilistic sensitivity analysis.

ICER=ΔCΔE\text{ICER} = \frac{\Delta C}{\Delta E}

where ΔC\Delta C is the incremental cost of the new treatment over usual care in GBP and ΔE\Delta E is the incremental effect in QALYs.

  1. Event 1, Model Run Completed. Run R1 uses model version 1.0 and parameter set P1. The incremental cost is GBP 4,500 and the incremental effect is 0.30 QALYs, so the ICER is 4,500 divided by 0.30, which gives GBP 15,000 per QALY.
  2. Event 2, Parameter Set Revised. The treatment's annual acquisition cost in P1 was entered wrongly. The correction is recorded as a new parameter set P2, with the date the corrected price was confirmed (3 March) and the date the new set was entered (5 March) kept as two separate times. Event 1 is not edited. While making P2, the analyst also mistypes one transition probability.
  3. Event 3, Model Run Refused. Run R2 with P2 is refused because the Well row of the transition matrix reads 0.85, 0.10 and 0.07. The row sums to 1.02, which breaks the rule that each row sums to 1, so no result set exists for R2.
  4. Event 4, Parameter Set Revised. The typing error is corrected back to 0.05 in a further parameter set P3, so the row sums to 0.85 plus 0.10 plus 0.05, which equals 1.00.
  5. Event 5, Model Run Completed. Run R3 with P3 reports an incremental cost of GBP 6,000 and the same 0.30 QALYs, so the ICER is 6,000 divided by 0.30, which gives GBP 20,000 per QALY.

The current state alone would show only the ICER of GBP 20,000 per QALY. The log adds why it moved by GBP 5,000 per QALY from the first run, since the only net change between P1 and P3 is the corrected acquisition cost and the QALY gain did not change, and it shows that the refused run left no result that could reach a report. The rule itself would live in a Rules and Invariants record with a tolerance, such as rows summing to 1 within 0.000001, and the planned component page for transition-matrix validation would refer to that record by its address instead of copying it.

Where domain events meet model checking and HTA practice

Model checking already asks questions that the traces kept by domain events help to answer. The TECH-VER checklist of Büyükkaramikli and colleagues asks whether all the results in the report, including the uncertainty analysis results, could be generated from the model. Section 5.5.15 of PMG36 asks a company submitting a fully executable model to ensure that the submitted model and the written evidence submission match. A Model Run Completed event that names the model version and parameter set behind each result makes both questions easier to answer, which supports technical verification and reproducibility.

Fowler's later note describes event sourcing, in which every change of state is recorded as an event so that the state can be rebuilt by replaying the events, with a version control system as his example. Evans's 2015 reference calls event sourcing one of the mainstream options for the architecture of a DDD system, so DDD does not require it.

How a domain event differs from nearby ideas

A clinical event in a discrete event simulation is part of the health economic model itself. The ISPOR-SMDM task force report by Karnon and colleagues defines events in DES as things that can happen to an entity or the environment, such as the onset of a stroke or admission to hospital. A domain event in Model Execution sits one level up, because the Domain Layer takes the work of building and running models as its domain, whereas software whose domain was clinical care could treat a stroke itself as a domain event. It would record that a whole DES run finished, not each simulated stroke within it. The DES entity, a simulated patient, is also distinct from an entity in the DDD sense, which is an object in the domain model with a lasting identity.

Evans separates domain events from system events that reflect activity within the software itself. Microsoft's guidance distinguishes them from integration events, which carry committed changes across bounded contexts to other services and should always be asynchronous. On the wiki's reading, a Result Set leaving Model Execution for a reporting context would travel in such a message, written in a published language agreed between the two contexts, and the relationship belongs on the context map.

Limits and common misreadings

Fowler's 2005 draft notes that capturing system inputs as domain events imposes a distinct architectural style that can seem awkward at first. Four misreadings are likely when the pattern is carried into health economic work.

  1. Recording everything. Evans asks for irrelevant activity to be ignored. A log of every cell edit in a workbook is a change history without the meaning of each change.
  2. Editing past events. An event describes the past and is ordinarily immutable. A wrong input is corrected by a further event, so the earlier result stays traceable.
  3. Using an event as a command. Fowler's 2017 article warns against a passive-aggressive command, where the sender expects an action but styles the message as an event. A request to rerun the base case is a command.
  4. Losing sight of the flow. The same article adds that event notifications can hide a logical flow that is not explicit in any code, so an automated living HTA pipeline still needs a written account of which events start which runs.

No source read for this page evaluates domain events in health economic modelling, so their value there is a design judgement to be checked in use.

Sources

Library

Publications

5
  • 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.

  • Other

    What do you mean by "Event-Driven"? — Fowler M, 2017 (martinfowler.com)

    Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Domain Event, 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

    Domain events: design and implementation — Microsoft, In .NET Microservices Architecture for Containerized .NET Applications, updated 29 December 2022 ed., 2022 (Microsoft Learn)

    Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Domain Event, where it is cited as a reference for that concept.

  • Other

    Domain Event — Fowler M, 2005 (Further Enterprise Application Architecture development (draft))

    Source listed in the Sources of the HealthEconomics.wiki Concept Architecture article on Domain Event, where it is cited as a reference for that concept.

Frequently Asked Questions (6)

  • What is Domain Event?

    A domain event in Domain-Driven Design is a record that something domain experts care about has happened, such as a health economic model run completing.

    Source: Evans 2015

  • Where does the term Domain Event come from?

    Software design is the source of the term, which was added to Domain-Driven Design after Eric Evans published his original book. His free 2015 reference lists it among the building blocks of a model and marks it as a term introduced since that book, summing it up as something that happened that domain experts care about. The term is new to health economics, and the wiki uses it in its Domain Layer to record the history of work around models.

    Source: Evans 2015

  • How does a Domain Event differ from a clinical event in a discrete event simulation?

    A clinical event in a discrete event simulation belongs to the health economic model itself. The ISPOR-SMDM task force report by Karnon and colleagues defines such events as things that can happen to an entity or the environment, such as the onset of a stroke or admission to hospital. In the wiki's Domain Layer, which applies Domain-Driven Design to modelling practice, a Domain Event describes the work around the model, so it would record that a whole simulation run finished, not each simulated stroke. The simulated patient in a discrete event simulation is also a different thing from an entity in the Domain-Driven Design sense.

    Source: Karnon et al. 2012

  • What information does a Domain Event usually hold?

    Eric Evans describes a Domain Event as ordinarily immutable, since it is a record of something in the past. Besides a description of what happened, it typically holds a timestamp for when the event occurred and the identities of the entities involved. It often holds a second timestamp for when the event was entered into the system and the identity of the person who entered it. An identity built from these properties lets two copies of the same event, such as a completed model run reported twice, be recognised as one.

    Source: Evans 2015

  • How could a Domain Event be used when running a health economic model?

    In a candidate Model Execution context, a Domain Event such as Model Run Completed could record the run, the model version, the parameter set and the time it finished. A reviewer could then trace any reported cost-effectiveness result back to the inputs that produced it. Smith and colleagues describe a living HTA pipeline in which the analysis reruns at set times or when triggered by an update to the underlying data or model code. Their paper does not use Domain-Driven Design terms, yet a data update that starts a rerun is close to what the method would model as a Domain Event.

    Source: Smith et al. 2022

  • How is a mistaken Domain Event corrected?

    A Domain Event describes something in the past, so its source data is not edited once the event has been recorded. Martin Fowler handles an error by recording a further event, which he calls a retroactive event, and processing it to correct the consequences of the earlier one. In health economic modelling, if an event recorded a wrongly entered drug cost, that event would stay in place and a further event would record the revised parameter set before a new model run. The earlier result then stays traceable, so a reviewer can see why the reported ICER changed between versions.

    Source: Fowler 2005

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-126

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/domain-event