UML状态图在DO和输入之间的差异

发布于 2025-02-01 04:37:27 字数 93 浏览 2 评论 0原文

我真的不明白进入和进行UML状态图中的活动之间的区别

如果我的状态称为CREATE帐户,并且该州要求用户输入他的姓名,ID和密码,

则 活动 ?

i really don't understand the difference between entry and do activities in UML state diagram

if i have state called create account and this state ask from user to enter his name,id and password

so enter name , id , password is entry activity or do activity ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莳間冲淡了誓言ζ 2025-02-08 04:37:27

不同之处在于,进入行为始终运行到完成,而DO行为仅在没有事件触发过渡的情况下才能完成。此事件将被打断。因此,它可能具有无尽的循环。如果效果 - 或出口行为具有如此无尽的循环,则statemachine将不再对事件做出反应。

作为旁注:创建帐户不是状态的好名称,因为它包含一个活动动词。这更适合一项活动。状态可以命名创建帐户。入门行为可以是创建帐户,这可以包括操作输入名称,输入ID 和输入密码。您还应该对用户取消创建的可能性进行建模。与Guards [帐户创建][取消]的两个完成过渡可以显示接下来会发生什么。

The difference is that the entry behavior is always run to completion, whereas the do behavior is only run to completion if no event triggers a transition. It will get interrupted by this event. Therefore, it could have an endless loop. If an effect-, do- or exit-behavior has such an endless loop, the statemachine will not react to events anymore.

As a sidenote: create account is not a good name for a state, since it contains an active verb. That is better suited for an activity. The state could be named creating account. The entry-behavior could be create account and this could include actions enter name, enter id and enter password. You should also model the possibility, that the users cancels the creation. Two completion transitions with guards [account created] and [canceled] could show what happens next.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文