JMU
State Models
with UML


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


System State
System State (cont.)
System State (cont.)
The State Space
The State Space (cont.)
System State (cont.)
The Size of the State Space
The Size of the State Space (cont.)
State Space: An Example

Use Case Descriptions

OpeningSource_UseCaseDescriptions
State Space: An Example (cont.)
System Dynamics
Components of UML Statemachine Diagrams
Example UML Statemachine Diagrams (cont.)
Pseudo States
Activities and Effects
Activities and Effects (cont.)
OpeningSource_ActivitiesOrEffects

In general, one should use an entry action when the behavior should be executed regardless of how the state is entered. On the other hand, one should use an effect when the behavior is specific to the transition.

Activities and Effects (cont.)
OpeningSource_FourStateModel
A "Real World" Example

The Transmission Control Protocol (TCP)

statechart_tcp
Timed Transitions
State Generalization/Specialization
XOR-Composition
XOR-Composition (cont.)

An Example

statechart_button

In the abstract model, this system has two states, Disabled and Enabled, and transitions between the two as a result of two events, Enable and Disable.

AND-Composition
Orthogonal Regions
Orthogonal Regions (cont.)

Example

statechart_keyboard

Note that, because of the orthogonal regions, we do not have to define the states UnlockedPositioning, LockedPositioning, UnlockedNumeric, and UnlockedArrows.

Orthogonal Regions (cont.)
Submachines
The Art of State Modeling
The Art of State Modeling (cont.)

Using AND-Composition for this System

statechart_colorlight2
The Art of State Modeling (cont.)

Using XOR-Composition for this System

statechart_colorlight3
A Comparison of Different UML Diagrams