问题
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