Search code examples
umlsymbolsdiagramsequence-diagramtermination

Sequence Diagram(termination of object)


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.


Solution

  • 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.