当前位置:网站首页>EA & UML Sun Arch - State Diagram :: Redraw Button State Diagram
EA & UML Sun Arch - State Diagram :: Redraw Button State Diagram
2022-07-29 23:53:00 【51CTO】
State diagram of the button handling module,It has been explained in the previous article,But when we model the signal system engine,It was found that the original design did not meet the needs,Therefore, the completed model needs to be modified.
Such modifications frequently occur during software development,What needs to be done is not to suppress this modification,Rather, let this modification happen as early as possible.This is also a role of modeling.
在前面的例子中,It is hoped that the stop button and the pedestrian through the request button can be expressed in a sequence diagram,As a result, neither situation is appropriate.This paper adopts another strategy:
- Design a state diagram for standard button handling,The stop button can use this state diagram
- Pedestrians extend the standard button module by requesting the button module
Standard button module state machine

Work状态
装置工作状态,This state contains two sub-states, valid and invalid.WorkStatus if acceptedShutdown要求,The transition to the completed state.从UMLState machine semantics,regardless of the statusWorkingthe substate of ,The above migrations all work.
Disable状态
The device does not accept user button actions.接受到DeviceEnable事件之后,向Enable状态迁移.
Enable状态
接受DeviceDisable事件以后,向Disable状态迁移;When a button press event is received,向Disable状态迁移,But at the same time send the button press event.
If compared with the previous button device state diagram,It should be seen that this scheme is clearer,The focus is also more prominent.
Pedestrian through the request button state machine

First, compare it with the standard button module state diagram,The difference can be seenEnableThe status is further refined,At the same time, the corresponding migration has also changed.Only the added part is described below.
LaterReportWait状态
In this state if the user presses the button,Button press events are not sent immediately,而是向CmdReady状态迁移.如果接收到SetInstantReport通知,则向InstantReportWait状态迁移.
InstantReportWait状态
When a button press event is received in this state,向Disable状态迁移,But at the same time send the button press event.
CmdReady状态
Entering this state means,The user pressed the request button.当接收到HandlerReady事件时,向Disable状态迁移,But at the same time send the button press event.
补充说明
Although the order in which the articles are issued is sequential,But actually the signal system engine module and the pedestrian pass request button module and the state diagram are designed at the same time,同时完成的.Of course it can be done one after the other.
Although the state diagram designed in the previous article describing the button module has been greatly modified,But object-oriented thinking is the same.
参考资料:
14.2 Behavior StateMachines (6)--Substate machine state
14.2 Behavior StateMachines (10) --记法
打开方法如下:
- 进入【面向对象思考】 公众号
- 打开【UML】-【UML2.5中文译文】菜单
- 选择【状态图】分类
- 选择相关文章
写在文章的最后
阅读更多更新文章,请扫描下面二维码,关注微信公众号【面向对象思考】

边栏推荐
- 决策树原理及代码实现
- shell编写规范和变量
- 子无序测试
- Elementary C language - first understanding of C language
- Mysql内外连接
- [2023 School Recruitment Questions] Summary of Common Interview Questions (7. Common Bus Protocols) (Continuously updated with subsequent interviews....)
- JetsonNano learning (6) Big pits and solutions that Jetson stepped on___Continuously updated
- Design for failure 12 common design ideas
- 单片机开发之拓展并行I/O口
- 437. The total path III low low
猜你喜欢

Analysis of miscellaneous diseases such as DNS domain name hijacking in instant messaging mobile terminal development

Design for failure常见的12种设计思想

全网最强 JVM 来袭!(至尊典藏版)

windows下 PHP 安装

go语言(函数、闭包、defer、panic/recover,递归,结构体,json序列化与反序列化)

Sentinel入门

关于 byte 的范围

devops学习(八) 搭建镜像仓库---jenkins推送镜像

高数下|三重积分的计算3|高数叔|手写笔记

mysql使用on duplicate key update批量更新数据
随机推荐
全国双非院校考研信息汇总整理 Part.5
很遗憾,没有一篇文章能讲清楚分布式事务
单片机开发之拓展并行I/O口
Tkinter:功能按钮Button
【云原生Kubernetes】二进制搭建Kubernetes集群(中)——部署node节点
Sentinel入门
指令集数据产品如何设计和实现报表协同系统——基于指令集物联网操作系统的工业协同制造项目开发实践
codeforces 线段树题单
【openlayers】Map【1】
Dropout回顾
Another new rule for credit cards is coming!Juphoon uses technology to boost the financial industry to improve service quality and efficiency
C陷阱与缺陷 第3章 语义“陷阱” 3.10 为函数main提供返回值
Elephant Swap:借助ePLATO提供加密市场的套利空间
能源企业数字化转型背景下的数据安全治理实践路径
C陷阱与缺陷 第5章 库函数 5.1 返回整数的getchar函数
彻底搞懂kubernetes调度框架与插件
多商户商城系统功能拆解18讲-平台端商家售后
管理区解耦架构见过吗?能帮客户解决大难题的
devops学习(三) K8环境部署jenkins
【无标题】