Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If-else return statements in sequence diagrams #191

Open
KendrickAng opened this issue Nov 26, 2019 · 6 comments
Open

If-else return statements in sequence diagrams #191

KendrickAng opened this issue Nov 26, 2019 · 6 comments

Comments

@KendrickAng
Copy link

In the lecture going through the sequence diagram past year question, the sequence diagram was drawn to have one return arrow in each of the if and else parts of an "alt" block. However, for Q2 of the mock practice paper, only one return arrow was drawn outside the alt block. Both had return statements in each of the "if" and "else" parts. Which convention should we follow?

image

image

Also, the second picture has an activation bar not exceeding the alt block while the bar exceeds the alt block in the first picture. Which one do we follow?

@damithc
Copy link
Collaborator

damithc commented Nov 26, 2019

Both are fine if the return is same. If the return value is different for the different alternatives, it needs to be the first one.

Also, the second picture has an activation bar not exceeding the alt block while the bar exceeds the alt block in the first picture. Which one do we follow?

It follows the meaning of the diagram. In the second case, the return is not part of the alternative branches in which case it should be outside of the alt box. As we put the return outside the box, the activation bar too has to extend to outside of the box.

@qweiping31415
Copy link

May I ask how should we deal with the parameters of generate(boolean hasExisting) executed in the past year question? hasExisting is passed as a parameter but is not reflected in the outer arrow before the alt box?

@damithc
Copy link
Collaborator

damithc commented Nov 28, 2019

May I ask how should we deal with the parameters of generate(boolean hasExisting) executed in the past year question? hasExisting is passed as a parameter but is not reflected in the outer arrow before the alt box?

For context, can give a screenshot?

@danielwys
Copy link

Am wondering the same thing. The generate(boolean hasExisting) call is located in the first image, quoted below:

image

Should it be generate() or generate(hasExisting)?

@damithc
Copy link
Collaborator

damithc commented Nov 28, 2019

Should it be generate() or generate(hasExisting)?

Should be generate(hasExisting) to be absolutely correct

@danielwys
Copy link

Thank you Prof!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants