admin管理员组文章数量:1303032
How to represent the folowing workflow in a UML sequence diagram, using combined fragments for the do...while loop :
do
Run script on server
Correct errors
while (there are errors)
This is what I came up with for now, but I think I've actually represented an infinite loop:
I've checked this stackoverflow question but the accepted answer doesn't use combined fragments (which don't have cardinality, I think)...
How to represent the folowing workflow in a UML sequence diagram, using combined fragments for the do...while loop :
do
Run script on server
Correct errors
while (there are errors)
This is what I came up with for now, but I think I've actually represented an infinite loop:
I've checked this stackoverflow question but the accepted answer doesn't use combined fragments (which don't have cardinality, I think)...
Share edited Feb 15 at 18:22 Christophe 73.6k7 gold badges82 silver badges167 bronze badges asked Feb 10 at 21:58 Patrick B.Patrick B. 1,32911 silver badges19 bronze badges1 Answer
Reset to default 2Both answers to the referred stackoverflow question suggest the use of a combined fragment with operator loop
, and should answer the question. However, unfortunately, they do not illustrate the solution adequately among the alternatives considered. So let me explain it accordingingly:
The loop uses a guard that may be composed of boundaries regarding the number of iterations and/or a boolean expression.
The wording in the UML specs suggest that the loop is guaranteed to be executed the minimum number of time. The wording also suggests that the loop stops if the condition is false after the minimum number of iterations. Although there is a little ambiguity left, the wording suggests that the condition has no impact on the minimum number of iterations.
Here some graphical explanations of different cases possible, including the one corresponding structurally to do
... while
:
Some people might misunderstand that the minimum number of iterations is only guaranteed if the guard is also true. This is not what is written in the UML specs but corresponds in good faith to the residual ambiguity. To avoid this, you can also use only a boolean expression, which can be in plain text:
本文标签: Represent dowhile loop in UML sequence diagram using combined fragmentStack Overflow
版权声明:本文标题:Represent do...while loop in UML sequence diagram using combined fragment - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741688452a2392581.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论