Show in graph

Software → Software Design

Domain Entity

A domain object defined primarily by a stable identity that persists through changes to its attributes.

Motivation

A Domain Entity represents something whose identity matters over time, even as its state changes.

Examples

An order, customer, account, or shipment may be an entity when the business must distinguish one instance from another.

Common mistakes

  • Treating every database row as a domain entity.
  • Using mutable attributes as identity.
  • Putting behaviour outside the entity when it owns the relevant rule.