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

images/OpeningSource_UseCaseDescriptions.gif
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.)
images/OpeningSource_ActivitiesOrEffects.gif

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.)
images/OpeningSource_FourStateModel.gif
A "Real World" Example

The Transmission Control Protocol (TCP)

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

An Example

images/statechart_button.gif

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

images/statechart_keyboard.gif

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

images/statechart_colorlight2.gif
The Art of State Modeling (cont.)

Using XOR-Composition for this System

images/statechart_colorlight3.gif
A Comparison of Different UML Diagrams