Terms and Concepts
A state diagram shows a state machine, emphasizing the flow of control from state to state. A state machine is a behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events. A state is a condition or situation in the life of an object during which it satisfies some condition, performs some activity, or waits for some event. An event is the specification of a significant occurrence that has a location in time and space. In the context of state machines, an event is an occurrence of a stimulus that can trigger a state transition. A transition is a relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified conditions are satisfied. An activity specifies an ongoing execution within a state machine. An action specifies a primitive executable computation that results in a change in state of the model or the return of a value. Graphically, a state diagram is a collection of nodes and arcs.NoteThe state diagrams used in UML are based on the statechart notation invented by David Harel. In particular, the concepts of nested states and orthogonal states were developed by Harel into a precise, formal system. The concepts in UML are somewhat less formal than Harel's notation and differ in some details, in particular, by being focused on object-oriented systems.
Common Properties
A state diagram is just a special kind of diagram and shares the same common properties as do all other diagramsthat is, a name and graphical contents that are a projection into a model. What distinguishes a state diagram from all other kinds of diagrams is its content.
The general properties of diagrams are discussed in Chapter 7 . |
Contents
Simple states, composite states, transitions, events, and actions are discussed in Chapter 22; activity diagrams are discussed in Chapter 20; notes and constraints are discussed in Chapter 6 . |
Like all other diagrams, state diagrams may contain notes and constraints.NoteA state diagram is basically a projection of the elements found in a state machine. This means that state diagrams may contain branches, forks, joins, action states, activity states, objects, initial states, final states, history states, and so on. Indeed, a state diagram may contain any and all features of a state machine.
Common Uses
The five views of an architecture are discussed in Chapter 2; instances are discussed in Chapter 13; classes are discussed in Chapters 4 and 9 . |
Active classes are discussed in Chapter 23; interfaces are discussed in Chapter 11; components are discussed in Chapter 15; nodes are discussed in Chapter 27; use cases are discussed in Chapter 17; systems are discussed in Chapter 32 . |