Statechart Diagrams
A statechart diagram is a UML diagram that models the dynamic behavior of individual class objects, use cases, or entire systems. Statechart diagrams show the sequences of states that an object goes through and the events that cause a transition from one state to another. They also show the actions that result from a state change. Statechart diagrams are similar to activity diagrams because both diagrams model the dynamic parts of a system and they both represent a state machine. The main difference between both diagrams is how they are used. Activity diagrams model workflow between activities in a process. Typically, you create statechart diagrams to examine classes and systems that have significant behavior.
Statechart diagrams may also contain nested states that represent different hierarchical state levels. Nested states allow you to examine complex object state change. For details, see States.
Using Statechart Diagrams
Statechart diagrams are helpful because they model dynamic behavior and are commonly used in developing real-time or event-driven systems. You can develop statechart diagrams in all phases of a software project. Possible uses of statechart diagrams include the following:
-
During business modeling, you can create statechart diagrams to model a use case scenario.
-
During analysis and design, you can model event-driven objects that react to events outside an object's context.
-
During analysis and design, you can use several statechart diagrams to show different projections of the same state machine and its behavior.
When you model event-driven systems with a statechart diagram, you use initial and final states to mark the beginning and end events that cause state transition, and junction states to represent the specific location where flow may branch or merge based upon a guard condition. Statechart diagrams also contain transitions, other kinds of pseudostates (choice points and deep and shallow history), deferred events, and constraints. For details, see Model Elements and Relationships in Statechart Diagrams.
Related Topics
- Working with Statechart Diagrams
- Activity Diagrams
- Working with State Machine (Activity and Statechart) Diagrams
|