Namine
Namine

Reputation: 45

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;

Upvotes: 1

Views: 7672

Answers (1)

Gangnus
Gangnus

Reputation: 24484

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.

Upvotes: 3

Related Questions