PrefaceUML is composed of dynamic graphs and static graphs, and the state diagram is one of the most important diagrams in dynamic graphs. definitionused to describe all possible states of a particular object and the transitions between states caused by the occurrence of various events.
Purposestudy the complex behavior of classes, roles, subsystems, or components.
constituent elementsStatusdefinition: Refers to a condition or condition in the life cycle of an object in which the object satisfies certain conditions, performs certain activities and waits for certain events alive. Representation method: Rounded rectangle.
Initial state and final state (Initial and final states): The initial state is represented by a solid dot, and the final state is represented by a circular inline dot.
Transferdefinition: A relationship between two states that indicates that an object will perform certain actions in the source State, and enter the target state when a particular event occurs and a particular policing condition is satisfied. event Marker (Trigger): Is the inducement of a transfer, which can be a signal, event, condition Change (a-in some condition) and time expression.
Policing Conditions (Guard Condition): When the police condition is met, the event will not cause a transfer (Transition).
result (Effect): The result of the object's state transition. Actionactions (Actions) in a UML state diagram are an executable atomic operation, which means that the action is non-interruptible and its execution time is negligible. Self-Transfera state can have a transition back to its own state, called its own transfer (self-transitions).
Combined Statea state that is nested in another state is called a sub-state (sub-state), and a state with a child state is called a combined state (Compound states).
Enter NodeThis node is called an ingress node (Entry point) for some reason that does not perform initialization (initialization), but rather enters the state "ready" directly through a node.
Exit NodeHistorical StateThe historical state is a pseudo state (pseudostate), whose purpose is to remember the sub-state in which it exits from the combined state, and when it enters the combined state again, it can go directly into the sub-state, rather than starting again from the initial state of the combined state.
Concurrency ZoneA state diagram can be divided into regions, and regions include exits or sub-states that are currently executing. Indicates that the combined state can reach multiple sub-states at a time.
State Machinedescribes the sequence of states that an object or an interaction undergoes in response to an event during its lifetime. The collaboration behavior between a single class or a group of classes is available as a state machine description. Computer room charge System State diagramyou are welcome to make valuable suggestions.
SummaryIt is not difficult to find that in UML diagrams, each diagram is interrelated, in particular, there are two of graphs closely related to each other, such as collaboration and sequence diagrams, as interaction diagrams, component and deployment diagrams as the implementation diagram, object and class diagrams are instantiated between the state diagram and the activity diagram is also associated. the difference between the two graphs:the state diagram is described from the result of the behavior. the activity diagram is described from the action of the behavior. A state diagram describes the possible states of a specific object and the conversions between them.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
UML State Diagram Statechart diagram