A behavior is a discrete computation or operation: it transforms one system state into another, taking inputs and producing outputs. This mechanical view applies even to actions that appear ephemeral, such as calling an API. section 5.3
Modeling behavior makes domain operations expressive, self-describing, and self-enforcing. Instead of allowing any invoice into a powerful method and defending against misuse at runtime, shape the operation so incorrect uses become impossible. section 5.2
Design behaviors by:
- Identifying the states before and after an operation. section 5.3
- Treating the requirements as machines that process one kind of data and produce another. section 5.3
- Deciding how many transformations the domain needs before filling in implementation details. section 5.3
Late fees and billing
A late-fee process can be modeled as a machine: raw invoices enter, late-fee invoices leave. A generic submitBill(Invoice) operation, by contrast, permits the wrong invoice type and relies on cryptic checks for invoice type, identifiers, and audit information. section 5.2 section 5.3
Figure 5.9 Visualizing behaviors as a factory. Data in; Data out.

Visualizes behavior as a factory with data entering on one side and transformed data leaving on the other. section 5.3





