1. What is a status chart?
A state chart describes all possible states of a specific object and the transfer between States caused by various events.
Ii. Status Chart Content
The graph shows the following statuses:
Conversion
Start Point
Endpoint
When a check is created, the check is in the unpaid status. When the check is paid, the check changes to the paid status and the check is voided.
1. Status
A condition is a condition or condition in which an object meets certain conditions during its lifecycle, executes certain activities, or waits for certain events.
A status includes the following parts:
1. name
2. entryaction/exit action
3. internal Conversion internal transition
4. substate
5. Delayed event deferred event
, Status example:
2. Conversion
A conversion is a relationship between two States, indicating that the object will perform certain actions in the first State, and enters the second State when a specific event occurs and a specific condition is met.
A Conversion consists of five parts:
Source state
Event trigger
Guard condition
Action
Target state
3. State Machine
A state machine is an action that describes a sequence of states that an object or an interaction experiences in responding to an event within its lifecycle.
The behavior of collaboration between a single class or a group of classes can be described using a state machine.
A state machine involves some other elements, including status, transition (streams from one State to another), and events (events that trigger conversion)
4. Compare the activity chart and status chart
The status chart focuses on describing the behavior results, while the activity chart focuses on describing the behavior actions.
From the application perspective,
In actual projects, the activity diagram is not mandatory. Generally, the activity diagram is used as follows:
Describes a parallel process or action.
Describe an algorithm
Describes an activity that spans multiple use cases.
The status chart describes the possible states of a specific object and the conversion between them.
Activity diagrams are more like flowcharts, focusing on logic and processes, while state diagrams focus on transition between States.
Is an activity diagram of building construction. It mainly describes the construction process of the building. The construction and transaction processing are parallel, reflecting the characteristics of the activity diagram that can describe parallel activities.
Is a state chart (the conversion condition is omitted) that describes the conversion process of each State. Compared with the above activity diagram, You can intuitively see the focus of the two diagrams.