当前位置:网站首页>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
边栏推荐
- 请问,redis没有消费消息,都在redis里堆着是怎么回事?用的是cerely 。
- The reason why data truncated for column 'xxx' at row 1 appears in the MySQL import file
- 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)
- Common response status codes
- Excuse me, I have three partitions in Kafka, and the flinksql task has written the join operation. How can I give the join operation alone
- 2022-7-6 Leetcode 977. Square of ordered array
- 课设之百万数据文档存取
- 最长上升子序列模型 AcWing 1012. 友好城市
- The meaning of variables starting with underscores in PHP
- call undefined function openssl_cipher_iv_length
猜你喜欢
通过 iValueConverter 给datagrid 的背景颜色 动态赋值
Codes de non - retour à zéro inversés, codes Manchester et codes Manchester différentiels couramment utilisés pour le codage des signaux numériques
2022-7-6 beginner redis (I) download, install and run redis under Linux
带你掌握三层架构(建议收藏)
Transferring files between VMware and host
VSCode 配置使用 PyLint 语法检查器
手把手教会:XML建模
Battle Atlas: 12 scenarios detailing the requirements for container safety construction
AI talent cultivation new ideas, this live broadcast has what you care about
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
随机推荐
Leetcode simple question sharing (20)
Lavarel之环境配置 .env
高等數學---第八章多元函數微分學1
Laravel Form-builder使用
. Net core about redis pipeline and transactions
Excuse me, I have three partitions in Kafka, and the flinksql task has written the join operation. How can I give the join operation alone
高等数学---第八章多元函数微分学1
[AI practice] Application xgboost Xgbregressor builds air quality prediction model (II)
一个简单LEGv8处理器的Verilog实现【四】【单周期实现基础知识及模块设计讲解】
股票开户首选,炒股交易开户佣金最低网上开户安全吗
The difference between memory overflow and memory leak
Clickhouse (03) how to install and deploy Clickhouse
属性关键字Aliases,Calculated,Cardinality,ClientName
Supply chain supply and demand estimation - [time series]
使用day.js让时间 (显示为几分钟前 几小时前 几天前 几个月前 )
最长上升子序列模型 AcWing 1012. 友好城市
请问,如图,pyhon云函数提示使用了 pymysql模块,这个是怎么回事?
Introduction to database system - Chapter 1 introduction [conceptual model, hierarchical model and three-level mode (external mode, mode, internal mode)]
NDK beginner's study (1)
Wired network IP address of VMware shared host