3

I prepared a university assignment where they asked me to create sequence diagram. Here is the diagram.

enter image description here

The teacher rejected the diagram and asked me to mention termination symbol in the diagram. I don't know what is the termination symbol in sequence diagram. The only thing I could find is a cross like symbol which destroys the object but I don't think thats what they are asking. Please help me.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
zeshan ahmad
  • 45
  • 1
  • 4
  • Is there anything in the narrative that says that a lifeline is supposed to terminate? I hope nobody will terminate the user. The form could perfectly not be terminated and stay with a hidden/inactive state. Same for the database validator. Last but not least, the sequence is about opening a page so the page should not be terminated either. And we’re not in an activity diagram where activities are supposed to have an end. – Christophe Jun 14 '22 at 17:59
  • Moreover, the diagram shows a scenario with 2 cases: what if the pwd is wrong? wouldn’t the other lifelines stay or would the login just stop and the system destroy itself? – Christophe Jun 14 '22 at 18:24

1 Answers1

2

You were just right: that's simply a diagonal cross at the end of the object's lifetime.

From UML 2.5 p. 713:

enter image description here

Basically you just put that centered on the dashed life line below the execution. Then of course it means that at that point in time the object is no longer existent and will neither accept nor send any message. For your picture it might be (I have to guess without knowing details!) be the Login form to terminate when Correct part is executed and the Home page comes into existence. As a side note I would use a createMessage

enter image description here

to actually create the Home page instance right at that point.

As a second side note: don't try to use SD as graphical programming tool. Best stay away from fragments as long as possible. Better you create several diagrams that show a distinct flow of events in a fixed context. That would be one diagram for the positive login and one for the negative attempt. Of course both are trivial cases and you would not need them - they are for academic purpose only. SDs are useful to bring light into complex collaborations. With a stress on complex.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • 1
    While I fully agree with the answer regarding what the termination symbol is, I cannot consent to the last sentence. The termination symbol isn't to be just placed anywhere because we need to have it by teachers request. Instead we need to have a valid reason. Example can be a creation of temporary data (e.g. session token) that is destroyed once certain condition is met. – Ister Jun 14 '22 at 11:41
  • @Ister I have made it a bit more wordy. Hope that would be more exaplantory now... – qwerty_so Jun 14 '22 at 21:35
  • 1
    Yes, much clearer now and my upvote goes to it ;-) – Ister Jun 15 '22 at 14:56