State Diagrams State diagrams: – Provides another dynamic view of aspects of system – Expresses: • Events • States • Behavior of an object in reaction to an event – Shows behavior of an object
Fig. 29. 1
State Diagrams Terminology: • Event – a significant occurrence (instantaneous, has no duration) • State – a condition of an object, time between events (has duration) • Transition – object moves from one state to another, triggered by an event Notation for each
State Diagrams Guideline: Consider state diagrams for statedependent objects with complex behavior Guideline: – Business information systems typically have few state -dependent classes/objects – Process control, device control, protocol handlers, communications systems typically have many statedependent objects See p. 488 for examples
State Diagrams Notations: • Action – an event may cause an action to fire • Conditional guard – a transition may be guarded by a boolean test, the transition fires only if event occurs at a point where test is true
State Diagrams Nested states – a state can contain substates – substates inherit transitions of enclosing state
State Diagrams Applying state diagram to web page navigation
State Diagrams Example from POS system: State diagram shows legal sequencing of use case operations. . .