nus-cs2103-AY2021S2 / forum

10 stars 0 forks source link

Alt return values in Sequence Diagram #364

Open justgnohUG opened 3 years ago

justgnohUG commented 3 years ago

In an Alt, for sequence diagrams, is to appropriate to have a return arrow within each Alt Condition as seen in(A), or is (B) more approriate.

PS: Noting the textbook says there should not be a break in activation bar, what would the stand on return values within Alts?

(A) image

(B) image

damithc commented 3 years ago

A and B have slightly different meanings. In B, the method returns the exact same thing no mater which alternative path is taken. In A, the returned value can be different based on the alt path taken. Either one can be used based on what's actually happening in the alt paths.