Field Manual PHP / Laravel reference
← Engineering

Domain modelling

Domain models name business concepts and their behavior.

What it is

Domain models name business concepts and their behavior.

When to use it

Clarify states, terms, invariants, and relationships before implementation.

Syntax

Account owns funds
Transfer moves a single currency
Ledger entry records movement

Example

Invariant: transfer amount > 0.
Invariant: source and destination differ.
Invariant: currency matches.
State: pending -> settled | failed.

Common mistakes

A noun list alone is not a model; identify rules and transitions.

Related topics

Browse Engineering