Design patterns·Who calls whom, and when
you wrote down every state and every allowed move between them, and three combinations you had shipped turned out to be impossible.
State machine
Also calledfinite state machine, FSM, state transition table
A model of an object as a fixed set of states plus the transitions permitted between them, usually recorded as a table or a diagram. Making it explicit is the highest-value modelling move available for anything with a lifecycle — an order, a subscription, a deployment — because the illegal transitions become visible instead of implied. The state pattern is one way to implement it; a table and a switch is often the clearer one.