返回布尔值的序列图 [英] Sequence diagram which returns a boolean
问题描述
我想知道如何在序列图中返回一个值,例如:
I want to know how to return a value in a sequence diagram, for example:
if(a>b) return true;
else return false;
推荐答案
这里有两个变体.
请注意,虚线表示返回消息.带参数的实线 - 调用消息.
Please, notice, that dashed line means returning message. Solid line with parameters - calling message.
全三角箭头表示同步调用.线角三角形箭头表示异步调用.但在返回消息箭头总是有这样的头.
Full triangle arrow head means synchronous call. Line angle triangle arrow head means asychronous call. But in the return message arrow ALWAYS has such head.
但是如果你真的有你所展示的那么轻的情况,最好直接使用alt"组合片段,而不是所有这三个消息.只需在它的两个操作数中显示您在这两个分支中的实际操作.
But if you really have so light cases as you have shown, it's better to use "alt" combined fragment directly, without all these three messages. Simply show in its two operands what you really do in these two branches.
这篇关于返回布尔值的序列图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!