当前位置:网站首页>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

边栏推荐
- 高等数学---第八章多元函数微分学1
- Environment configuration of lavarel env
- 最长上升子序列模型 AcWing 1014. 登山
- What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
- 高等數學---第八章多元函數微分學1
- Attribute keywords aliases, calculated, cardinality, ClientName
- 3D Detection: 3D Box和点云 快速可视化
- 手里的闲钱是炒股票还是买理财产品好?
- 2022-7-7 Leetcode 844. Compare strings with backspace
- 带你掌握三层架构(建议收藏)
猜你喜欢

Battle Atlas: 12 scenarios detailing the requirements for container safety construction

带你掌握三层架构(建议收藏)

Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
![[Reading stereo matching papers] [III] ints](/img/d3/4238432492ac3dc4ec14a971b8848d.png)
[Reading stereo matching papers] [III] ints

最长上升子序列模型 AcWing 1014. 登山

UML 顺序图(时序图)

Selenium库

2022-7-6 Leetcode27. Remove the element - I haven't done the problem for a long time. It's such an embarrassing day for double pointers

docker部署oracle

通过 iValueConverter 给datagrid 的背景颜色 动态赋值
随机推荐
Horizontal of libsgm_ path_ Interpretation of aggregation program
最长上升子序列模型 AcWing 482. 合唱队形
648. Word replacement: the classic application of dictionary tree
Cesium 已知一点经纬度和距离求另一个点的经纬度
内存溢出和内存泄漏的区别
Transferring files between VMware and host
requires php ~7.1 -> your PHP version (7.0.18) does not satisfy that requirement
c#利用 TCP 协议建立连接
Did login metamask
call undefined function openssl_cipher_iv_length
Selenium库
Vscode configuration uses pylint syntax checker
gvim【三】【_vimrc配置】
Best practice | using Tencent cloud AI willingness to audit as the escort of telephone compliance
C # switch pages through frame and page
Attribute keywords aliases, calculated, cardinality, ClientName
Is the spare money in your hand better to fry stocks or buy financial products?
请问,PTS对数据库压测有好方案么?
【网络安全】sql注入语法汇总
杭电oj2092 整数解