Domain Driven Design terminology

Notes from Domain Driven Design: Complete Software Architecture Course.

Generic terms

Domain: Subject area around which the program is going to be built.

Domain Model: Conceptual object model representing different parts of the domain (both behaviour and data).

Bounded Context: Context to which a model can be applied.

Ubiquitous Language: Common domain language used within the team and in the code.

Building blocks

Entity: Object identified by a thread of continuity and/or its identity, rather than by its attributes.

Value: Object that has attributes, but no identity. It should be treated as immutable.

Aggregate: Collection of values and entities bound together by a root entity (Aggregate Root) that encapsulates them. External objects should not reference Aggregate Root members (it ensures consistency of changes made).

Domain Event: An event directly related with the domain.

Example

Name, Address are Values:

  • no need to be identifiable
  • won’t change

Customer is an Entity:

  • uniquely identifiable
  • may need to change over time

Hotel Room is an Entity:

  • uniquely identifiable

Booking is an Aggregate:

  • encapsulates Customer and Hotel Room entities
  • could encapsulates other properties (e.g. booking date)

Booking Created is a Domain Event:

  • event directly related to the Domain

Leave a comment