外文翻译--uml20序列图组合碎片(编辑修改稿)内容摘要:

equal to the amount because of the [else] guard. In alternative bination fragments, the [else] guard is not required。 and if an operand does not have an explicit guard on it, then the [else] guard is to be assumed. Alternative bination fragments are not limited to simple if then else tests. There can be as many alternative paths as are needed. If more alternatives are needed, all you must do is add an operand to the rectangle with that sequence39。 s guard and messages. Option The option bination fragment is used to model a sequence that, given a certain condition, will occur。 otherwise, the sequence does not occur. An option is used to model a simple if then statement (., if there are fewer than five donuts on the shelf, then make two dozen more donuts). The option bination fragment notation is similar to the alternation bination fragment, except that it only has one operand and there never can be an else guard (it just does not make sense here). To draw an option bination you draw a frame. The text opt is placed inside the frame39。 s namebox, and in the frame39。 s content area the option39。 s guard is placed towards the top left corner on top of a lifeline. Then the option39。 s sequence of messages is placed in the remainder of the frame39。 s content area. These elements are illustrated in Figure 9. Figure 9: A sequence diagram fragment that includes an option bination fragment Reading an option bination fragment is easy. Figure 9 is a reworking of the sequence diagram fragment in Figure 7, but this time it uses an option bination fragment because more messages need to be sent if the student39。 s past due balance is equal to zero. According to the sequence diagram in Figure 9, if a student39。 s past due balance equals zero, then the addStudent, getCostOfClass, and chargeForClass messages are sent. If the student39。 s past due balance does not equal zero, then the sequence skips sending any of the messages in the option bination fragment. The example Figure 9 sequence diagram fragment includes a guard for the option。 however, the guard is not a required element. In highlevel, abstract sequence diagrams you might not want to specify the condition of the option. You may simply want to indicate that the fragment is optional. Loops Occasionally you will need to model a repetitive sequenc。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。