Constraining Associations
Explanation
Section titled “Explanation”An association is a link between two kinds of objects in a model, such as an order and its line items. See the article on UML Association. Conceptually, you can follow such a link in both directions. In a design, you decide which directions you really need. This is called navigability. It is a design decision tied to how the code implements the link (f6). UML leaves the exact mechanism to the implementation (f7).
Evans advises constraining relationships as much as possible. Understanding the domain may reveal a natural directional bias (f1).
Two techniques follow from this.
Impose a traversal direction. An Order can reach its LineItems. A LineItem cannot navigate back to its Order, because line items are rarely needed without starting from the order (f2).
Add a qualifier. A qualifier selects objects from a larger related set by a key. It usually reduces the far end of the link from many to one (f4). It suggests a lookup by key, like a map, rather than holding a full collection (f5).
A removed direction does not have to vanish. The reverse question, such as all orders of a customer, can be answered by a repository query method. You add it only if that context needs it (f3). A repository is an object that handles queries and persistence.
Example
Section titled “Example”A shop model has Customer and Order. At first, each Customer holds a list of all its Orders, and each Order points back to its Customer. The team asks which directions the application really uses. Staff always start from an order, so Order keeps its link to Customer. Customer drops its list of orders. When a screen needs a customer’s orders, the order repository gets a query method for it. The model still answers both questions, and the code carries one fewer link.
Trade-offs
Section titled “Trade-offs”Removing a direction means the reverse question needs another route, such as a repository query. You add that query only where a context needs it (f3). Which directions to keep is a design decision, so it depends on how the domain is actually used (f1, f6).
Diagram source
@startumlclass Orderclass LineItemclass CustomerOrder --> "*" LineItemOrder --> Customer@endumlChecks
Section titled “Checks”- Associations that can only be used in one direction are marked with a traversal direction.
- Where the reverse direction is needed, the document names a repository query instead of a second navigation link.
- Associations with a key-based lookup show a qualifier that reduces the far-end multiplicity.
Related
Section titled “Related”- UML Association
- Domain Model
- Aggregate
- Cargo Shipping Domain Model
- Domain-Driven Design
- Reduce Coupling
- UML Class Diagram
Sources
Section titled “Sources”- Data Points - Coding for Domain-Driven Design: Tips for Data-Focused Devs, Part 3 | Microsoft Learn — learn.microsoft.com, accessed 2026-11-09
- 16.15 Qualified Association | Applying UML and Patterns: UML Class Diagrams | InformIT — informit.com, accessed 2026-11-09
- Navigability of associations is NOT a conceptual modeling concern — modeling-languages.com, accessed 2026-11-09