简体   繁体   中英

Difference between types of messages in sequence diagrams

What is the difference between?

Self message Recursive message Re-entrant message

thanks

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!!!

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);
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM