PA116 DUM Statechart diagram Statechart diagram aka State diagram or State machine diagram 1) Shows behavior of classes in response to stimuli 2) Used to describe systems with significantly dynamic behavior, i.e. those that change their states in non-trivial manner 3) The stimuli can be either external or internal Statechart diagram II • Illustrates system lifecycle from initation to termination • Highlights events that cause change of system state • Records action that are successors to changed states Notation State Simple / Composite / Substate Described by the event that triggered the change from one state to another Transition Initial state Final state Fork Decision Join How to model it 1. Decide which parts of system show interesting dynamics of behavior 2. Identify important objects to be analyzed (see: Class diagram) 3. Identify the states 4. Identify the events that trigger state transition (see: Yourdon‘s event partitioning, processes in DFD) 5. Repeat steps 3 and 4 Example