当前位置:网站首页>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中文译文】菜单
- 选择【状态图】分类
- 选择相关文章
写在文章的最后
阅读更多更新文章,请扫描下面二维码,关注微信公众号【面向对象思考】
边栏推荐
- C陷阱与缺陷 第4章 链接 4.4 形参、实参与返回值
- devops学习(八) 搭建镜像仓库---jenkins推送镜像
- jenkins搭建部署详细步骤
- go语言(函数、闭包、defer、panic/recover,递归,结构体,json序列化与反序列化)
- Elephant Swap:借助ePLATO提供加密市场的套利空间
- [2023 School Recruitment Questions] Summary of Common Interview Questions (7. Common Bus Protocols) (Continuously updated with subsequent interviews....)
- logback过期日志文件自动删除
- 种类并查集(反集),学习T宝代码
- Redis系列:高可用之Sentinel(哨兵模式)
- y81.第四章 Prometheus大厂监控体系及实战 -- 监控扩展(十二)
猜你喜欢
devops学习(三) K8环境部署jenkins
windows下 PHP 安装
接口性能测试方案设计方法有哪些?要怎么去写?
The latest Gansu construction welder (construction special operation) simulation question bank and answer analysis in 2022
WLAN笔记
CesiumJS ^ source read [0] 2022 - article directory and source engineering structure
MySQL六脉神剑,SQL通关大总结
Why does LabVIEW freeze when saving a VI
idea设置自动去除未引用(不再引用)的引用
devops学习(五) Jenkins 简单完成持续部署
随机推荐
esp12f + tft 显示图片问题
Super RVRT
重庆OI 2005 新年好
idea设置自动去除未引用(不再引用)的引用
PyTorch笔记 - Attention Is All You Need (1)
随便记记第二周
Getting Started with Sentinel
windows下 PHP 安装
C陷阱与缺陷 第5章 库函数 5.1 返回整数的getchar函数
2022/7/29 考试总结
新标杆!美创科技助力广西桂林某三甲医院实现勒索病毒主动防御
The difference and usage of call, apply and bind
管理区解耦架构见过吗?能帮客户解决大难题的
Farmers on the assembly line: I grow vegetables in a factory
全国双非院校考研信息汇总整理 Part.3
JetsonNano learning (5) JetsonNano installs PyTorch and Torchvision
全国双非院校考研信息汇总整理 Part.5
一文解答web性能优化
HRNet-Facial-Landmark-Detection 训练自己数据集
devops学习(五) Jenkins 简单完成持续部署