Modeling class dynamic behavior with State diagram
Whereas Interaction and Collaboration diagrams model dynamic sequences of action among groups of objects in a system, the State diagram models the dynamic behavior of a particular object or class of objects.
A State diagram is modeled for all classes deemed to have significant dynamic behavior. This type of diagram models the sequence of states an object of a class goes through during its life. The State diagram captures the object's received stimuli, responses, and actions.
For example, the State diagram models an object's behavior in terms of what state it is in initially and what state it transitions to when a particular event is received. It also models what actions an object performs while in a certain state.