Assertions (Concept)

April 25, 2025 · View on GitHub

Description

state post-conditions of operations and invariants of classes and aggregates

Tags

pattern

Documentation

When the side effects of operations are only defined implicitly by their implementation, designs with a lot of delegation become a tangle of cause and effect. The only way to understand a program is to trace execution through branching paths. The value of encapsulation is lost. The necessity of tracing concrete execution defeats abstraction.

Therefore,

State post-conditions of operations and invariants of classes and AGGREGATES. If assertions cannot be coded directly in your programming language, write automated unit tests for them. Write them into documentation or diagrams where it fits the style of the project’s development process.

Seek models with coherent sets of concepts, which lead a developer to infer the intended assertions, accelerating the learning curve and reducing the risk of contradictory code.

Assertions define contracts of services and entity modifiers.

Assertions define invariants on aggregates.

Other Relations

FromNameToDescription
Intention-Revealing Interfacesmake side effects explicit withAssertions

Concept Map

Concept Map of the Domain Driven Design Supple Design Patterns

Concept Map of the Domain Driven Design Supple Design Patterns

List of views in namespace

List of all Views

(generated by Overarch with template docs/node.md.cmb)