uml - 这个序列的最佳 UML 图是什么?
问题描述
我目前正在学校完成我的期末项目。并且即将毕业。我一直在使用 UML 图时遇到困难,我正在努力决定应该使用哪一个来描绘我的代码。
我的代码是一个 python 脚本,并包含一个按以下方式工作的循环:
I run the script from a terminal ->
Terminal listens to two keys (W & Q).
If Q is pressed the script stops.
If W is pressed the loop begins in the following order:
Raspberry Pi camera takes a picture ->
Crop specific portion out of said picture and save it ->
Run Text recognition on that picture, which returns a text string and is saved in a variable ->
Run Regex to filter out junk characters from text string and create new "clean" text string ->
Run GET request to website using clean text string, and get return based on it. ->
Print out response from request.
哪个图表是使这个序列易于理解的最佳选择。我研究了各种图表,例如系统序列图等。但我还没有找到任何对我来说真正有意义的东西。我应该求助于使用流程图吗?或者有什么更适合我使用的东西吗?
解决方案
您想使用事件驱动的流程链 (EPC)。
在这种情况下(没有看到您的代码),我建议使用“事件驱动的流程链”简称:(EPC) , [德语: (EPK), Ereignisgesteuerte Prozesskette]。
UMLs 大多数时候习惯于显示“类结构”而不是链/脚本中的过程。
EPC 使用逻辑运算符,例如 OR、AND 和 XOR,它们可以表示如下事件:
'终端监听两个键(W & Q)' => XOR -> W ->Q
你可以在这里阅读更多关于它的信息。
编辑:
如果您仅限于 UML 图:
在七个行为 UML 图中,您确实应该使用用户 qwerty_so 建议的“UML 活动图”。它类似于 EPC,可以描述为 UML 的“流程图”变体。
UML 图仅限于六个“结构”UML 图和七个“行为”UML 图:
行为 UML 图
- 活动图
- 序列图
- 用例图
- 状态图
- 通讯图
- 交互概览图
- 时序图
您可以在此处阅读有关活动图的更多信息。
您可以在此处阅读有关 UML 图类型的更多信息。
推荐阅读
- branch.io - 在被人 X 推荐后,如何获取安装我的应用程序的人的用户 ID?
- django - django:如何在 html_email 中显示图像
- node.js - 尝试通过 Node.js 和 MongoDB 中的 GET 请求进行搜索查询
- c# - C#,无法从 HttpRequest 检索“Request.UserHostAddress”
- flutter - Flutter - 点击/触摸区域如何工作?
- google-sheets - 如何根据 Google 表格中的其他单元格值计算文本
- kubernetes - 部署 yaml 文件时出现 BadRequest 错误
- excel - 使用 Excel VBA 在 OneDrive 上打开文件
- matomo - Matomo UserID 特定报告
- python - python中的可变类型