How the analysis works
One service can implement two business actions
Customer cancellation and a support override may share an update method. The domain model gives each action a name, its own actor and a place to attach the rule that determines when it can run.
Domain modeling from source code
The model
See how a domain model connects order states, cancellation actions and business rules to code, schema and requirements evidence.
Actors, actions, rules and states for cancellation. Support override is drawn dashed: it may share the code, but it is a different business action.
- Entity
- Field
- Action
- Rule
- State
- API
- Event
- Service
status VARCHAR(20) NOT NULLNever empty
V12__orders.sql:7@Column(nullable = true)
private String status;May be empty
Order.java:31status?: OrderStatusOptional
openapi.yaml:212Three honest answers to “can status be empty?”. A tool that merged these by name would pick one and hide the other two. The twin keeps all three, flags the conflict, and leaves the decision to a person.
Walkthrough
Step by step.
Start from declarations and behaviour
A status column is evidence of storage. A route is evidence of registration. A guard and a write support an order-state transition on a specific path. Keep each witness available when an assertion connects them.
Label the interpretation
Reading the guard supports the shipped-order rejection on the customer path. Calling that path a customer policy is an interpretation. A requirement for future line-item cancellation is intended behaviour. An observed test result applies to its test inputs and version.
Preserve conflicting representations
An API field can be optional, an ORM mapping can allow nulls and a database can enforce a constraint. Keep the three claims separate. A plausible mapping or shared name needs evidence before it can settle their meaning.
Three claims about the same state
| Claim | Classification | Evidence |
|---|---|---|
| Order status is stored | Extracted | Column declaration in the captured schema |
| The shipping guard protects customer cancellation | Observed in source within scope | Guard and customer path in the captured version |
| Support can cancel one unshipped line | Intended | Approved version of the proposed requirement |