A state transition changes an object from one state to another when one or more attributes change. Because behavior depends on current state, transitions determine what the object can do next. section 1.8 section 13.0
The State Design Pattern organizes named states, the events or actions that move between them, and the behavior available in each state. Transitions may be caused by users or by the object itself. section 13.0 section 13.1
Automatic ticket machine
A ticket machine moves from READY to VALIDATING when a customer inserts a card. A valid card leads to TICKET_SOLD; an invalid card returns to READY. Taking the last ticket leads to SOLD_OUT, which has no outgoing ticket-sale transitions. Removing a card, taking a ticket too early, or repeating an action produces state-dependent behavior. section 13.1






