Modelling Aggregates: Invariants vs Corrective Policies

Designing software systems that are aligned with business often leads to compromises and design tradeoffs. It's usually not feasible to model a system in a way that will in 100% reflect the real world.

Understanding business rules is the first step of getting a useful model, but that's not enough. Modelling them as software often leads to discoveries - we realise that it might not be practical, or even possible to enforce some of the rules.

The right thing to do in such a situation is to go back to domain experts and discuss the trade offs we are willing to make. That might mean that we will have to give up on implementing a strongly consistent Invariant and replace or support it with a Corrective Policy.

Read more