0
7.1kviews
Describe create and destroy message used in sequence diagram with example. OR Explain with diagram create and destroy messages.

OR

How to create and destroy messages in sequence diagram?

OR

Explain with diagram create and destroy messages.

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
0
689views

Create message:

  • Objects can be created according to the requirement of the system in between the processing of the system because they are not required for the entire duration of the sequence diagrams interaction.
  • If an object does not exist at the beginning of a sequence diagram then it must be created in the system.
  • The UML shows creation by placing the object notation at the head of the arrow for the message call that creates an object.

Destroy message:

  • An object can destroy itself or it can be destroyed by other objects of the sequence diagram because those objects may not be further required during the system.
  • If the object is destroyed by itself then “X” is placed at the tail of the line and arrow head is towards another object to which it passes the control.
  • If the object is destroyed by another object then a destroy message is send by another object from the system. In this case the large “X” is placed at the head of the return arrow.

Example:

enter image description here

Please log in to add an answer.