Sequence diagram which returns a boolean

杀马特。学长 韩版系。学妹 提交于 2020-01-07 06:27:25

问题


I want to know how to return a value in a sequence diagram, for example:

if(a>b) return true; 
else return false;

回答1:


Here are two variants.

      

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.

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.



来源:https://stackoverflow.com/questions/21295166/sequence-diagram-which-returns-a-boolean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!