Get the App
SLTechnology News&Howtos  ›  Development  › 

How to draw UML state machine diagram

Shulou Source: shulou.com Published: 2022-06-02 05:40:20 10月01日 Update

This article mainly introduces how to draw UML state machine diagram, the article is very detailed, has a certain reference value, interested friends must read!

UML states and UML state machines

State, State Representation and State Machine

A state is a condition or condition that satisfies certain conditions, performs certain activities, or waits for certain events in the life cycle of an object.

◆ A state usually consists of five parts: name, entry/exit activity, internal transition, sub-state and delayed event.

State machines are part of computer science theory, but the state machine model in UML is mainly based on David Harel's extensions, which are diagrams used to show transitions between states

How to Draw UML State Machine Diagrams

Draw state machine diagram

The ideal steps for drawing a state machine diagram are to find the main states, determine transitions between states, refine activities and transitions within states, and expand details with composite states.

◆ Find the main status: For the flight reservation system, the obviously included status mainly includes

--When the aircraft is first scheduled, it is obvious that there are no reservations, and it will be in this "no reservations" state until someone books the ticket

--There are obviously two states for reservations: "partially booked" and "fully booked"

- And when the flight is about to take off, obviously "booking closed"

To summarize, there are four main states: no booking, partial booking, full booking and closed booking

UML State Machine Diagram Application Notes

Modeling the life cycle of an object: describing events to which the object can respond, responses to those events, and past influences on current behavior

Modeling reactive objects: the stable states that the object may be in, the triggering events required to transition from one state to another, and the actions that occur when each state changes

UML state machine diagrams can be used to represent knowledge of a business domain or to describe state transitions of objects in the design phase.

The above is "how to draw UML state machine diagram" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

Tags: Status reservations objects events between activities content cycles air tickets conditions life knowledge articles flights parts business areas individual departments values interests Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker NVidia Huawei Redmi