2

I have a couple of questions about UML.

  • Firstly, how would you show "Use Case Ends" on a sequence diagram.
  • Secondly, if you have an alt in a sequence diagram for "Variable == false", would you need to show what would happen if the variable is true, even if nothing would happen other than moving onto the next method call?
  • Third, isn't the last arrow on the diagram always going to be asynchronous, because it can continue and does not have to wait?

migrated from stackoverflow.com Jan 11 '14 at 4:47

This question came from our site for professional and enthusiast programmers.

2

A sequence diagram ends at the bottom. It's read top left with the next function call placed lower in the diagram. There's no need to explicitly mark the end of the diagram, since there's no more function calls and the activation boxes and lifelines end. If, at the end of the part of the application that you are showing, delete resources, you can add an "X" to the end of the lifelines to denote this, but it's often not required.

When you have an alternative path in a sequence diagram, you only need to indicate the "true" and "false" path if they are mutually exclusive. For example, if you have a series of calls that only happen when the variable is false, include those in an box labeled as such. If there are branches, I've typically seen a dotted horizontal line through the alt box and a new condition labeled right below the line.

I'm not sure what exactly you mean with your last question. It doesn't have to be asynchronous. It all depends on what you are showing in your sequence diagram.

You may be interested in this page, by Scott Ambler on UML sequence diagrams, as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy