当前位置:网站首页>UML state diagram
UML state diagram
2022-07-07 14:14:00 【sinat_ thirty-six million seven hundred and eighty-nine thousan】
One 、 State diagram
A class defines an abstraction of a set of objects , Each object is an instance of a class , But for an object , It has a series of States throughout its life cycle . State describes the dynamic life cycle of an object .
“ people ” It's a class , and “ you ”、“ I ”、“ Zhang San ” Are all “ people ” An instance of this class ,“ stand ”、“ lying ” Wait is a state of the object .
Throughout the life cycle of an object , Its state will change , The state machine is used to represent the state changes and the response to events of an object in its life cycle .
Two 、 Constituent elements 、 State machine
A state machine is a partial view of an object 、 A view that separates an object from its external world and examines its behavior independently . State machines are a good way to accurately describe behavior .
For example, describe the detailed behavior of the water heater when it works :
state : It means that certain conditions are met in the object life cycle 、 A condition or condition that performs certain activities or waits for certain events .
Start state
End state
Naming status
In a state machine diagram , There are no more than two core elements : One is the state represented by rounded rectangles ; The other is between States 、 A directional arrow line containing some text descriptions , These arrows become transformation .
A transition is a relationship between two states , Indicates that the object will perform certain actions in the first state , And enter the second state when a specific event occurs and the conditions are met .
3、 ... and 、 How to draw a state diagram
The ideal step to draw a state diagram : Look for the main state 、 Determine the transition between States , Refine the activities and transitions within the state , Expand details with composite States
1、 Main status of search
When drawing the state machine diagram , The most important activity is to find out the main state . For flight reservation system , Obviously, the states included mainly include :
a、 When determining the flight plan , Obviously, there is no reservation , And it will be in this situation before someone makes a reservation “ No reservation ” state
b、 For reservation , Obviously there is “ Partial reservation ” and “ Booked ” Two kinds of state
c、 When the flight is about to take off , Obviously “ Reservation closed ”
summary : There are four states : No reservation 、 Partial reservation 、 The reservation is completed and closed
2、 Determine the relationship between States
After determining the main state, analyze the transition between States , Draw the corresponding state machine diagram
边栏推荐
- The delivery efficiency is increased by 52 times, and the operation efficiency is increased by 10 times. See the compilation of practical cases of financial cloud native technology (with download)
- Data flow diagram, data dictionary
- 请问,如图,pyhon云函数提示使用了 pymysql模块,这个是怎么回事?
- FCOS3D label assignment
- Laravel form builder uses
- Realization of search box effect [daily question]
- Huawei image address
- Horizontal of libsgm_ path_ Interpretation of aggregation program
- Beginner XML
- Cesium knows the longitude and latitude of one point and the distance to find the longitude and latitude of another point
猜你喜欢
Excerpt from "misogyny: female disgust in Japan"
Use day JS let time (displayed as minutes, hours, days, months, and so on)
Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
Assign a dynamic value to the background color of DataGrid through ivalueconverter
Verilog implementation of a simple legv8 processor [4] [explanation of basic knowledge and module design of single cycle implementation]
Flask session forged hctf admin
Hands on Teaching: XML modeling
"New red flag Cup" desktop application creativity competition 2022
2022-7-6 Leetcode 977. Square of ordered array
最长上升子序列模型 AcWing 482. 合唱队形
随机推荐
. Net core about redis pipeline and transactions
IP and long integer interchange
Battle Atlas: 12 scenarios detailing the requirements for container safety construction
oracle 非自动提交解决
Clickhouse (03) how to install and deploy Clickhouse
MySQL "invalid use of null value" solution
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
Flask session forged hctf admin
Vmware共享主机的有线网络IP地址
566. Reshaping the matrix
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
Cesium 已知一点经纬度和距离求另一个点的经纬度
THINKPHP框架的优秀开源系统推荐
Environment configuration of lavarel env
Hands on Teaching: XML modeling
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
UML 顺序图(时序图)
[daily training -- Tencent select 50] 231 Power of 2
PERT图(工程网络图)
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array