Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between types of messages in sequence diagrams

What is the difference between?

Self message Recursive message Re-entrant message

thanks

like image 775
Milena Avatar asked Jun 05 '10 11:06

Milena


People also ask

What is the difference between message and call in sequence diagram?

I'm talking about the sequence diagram where you have two main options of elements for interaction. One is called message (which I assume you're calling signal) and the other is called call. Ok, but if that's the difference is only in being synchronous or asynchronous, why can I set both messages and calls to be sync/async?

What is an example of a sequence diagram?

The following is an example of a sequence diagram: Messages – Communication between objects is depicted using messages. The messages appear in a sequential order on the lifeline. We represent messages using arrows. Lifelines and messages form the core of a sequence diagram.

What is the difference between UML sequence diagram and collaboration diagram?

The collaboration diagram also comes under the UML representation which is used to visualize the organization of the objects and their interaction. The sequence diagram are used to represent the sequence of messages that are flowing from one object to another.

What is the difference between synchronous and sequential messages?

The messages appear in a sequential order on the lifeline. We represent messages using arrows. Lifelines and messages form the core of a sequence diagram. Synchronous messages – A synchronous message waits for a reply before the interaction can move forward.


2 Answers

A Self Message is a type of message which represents the execution or operation call in the same object lifeline.

A recursive message is a type of self message that is executed recursively.

A re-entrant message is where you have an object A and and oject B.

  • A makes a call C to B
  • B needs some data from A to complete call C
  • B sends a message to A get the data required to complete call C

The call that B makes to A is called a re-entrant message.

Hope that makes sense!!!

like image 87
Robben_Ford_Fan_boy Avatar answered Sep 30 '22 15:09

Robben_Ford_Fan_boy


The result of a call to E function is used to complete a call to another function in the same lifeline with the E function.

Example: Function Main from lifeline of ControllerC object colect data from EvaluateStudent function (located in StudentC scope) in order to use it as parameter for a call to another function also located in the same scope of StudentC. It is importent that the calls to be performed from outside the scope of StudentC. In our case the calls are performed from ControllerC.

public StudentC
{
    public function int EvaluateStudent(object student) 
    {
       /*... perform complex evaluation here ...*/ 
    }

    public function int IsTopStudents(int score, int acceptanceLevel)
    { 
       return(score > acceptanceLevel); 
    }
}

public ControllerC{     
    Public function Main()
    {
       IsTopStudent(EvaluateStudent(student), 8);
    }
}
like image 42
profimedica Avatar answered Sep 30 '22 16:09

profimedica