문제

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

if(a>b) return true; 
else return false;
도움이 되었습니까?

해결책

Here are two variants.

lighter variant        heavier variant

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top