序列图中消息类型之间的差异

发布于 2024-09-05 03:33:52 字数 47 浏览 3 评论 0原文

有什么区别?

自我留言 递归消息 再次留言

感谢

What is the difference between?

Self message
Recursive message
Re-entrant message

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幼儿园老大 2024-09-12 03:33:52

自消息是一种消息,表示同一对象生命线中的执行或操作调用。

递归消息是一种递归执行的自身消息。

可重入消息是指您拥有对象 A 和对象 B。

  • A 对 B 进行调用 C
  • B 需要来自 A 的一些数据才能完成调用 C
  • B 向 A 发送消息以获取完成调用所需的数据 C

调用B 向 A 发出的消息称为可重入消息。

希望这是有道理的!!!

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

つ低調成傷 2024-09-12 03:33:52

对 E 函数的调用结果用于完成对与 E 函数处于同一生命线中的另一个函数的调用。

例子:
ControllerC 对象生命线中的 Main 函数从 EvaluateStudent 函数(位于 StudentC 范围内)收集数据,以便将其用作调用也位于 StudentC< 范围内的另一个函数的参数/强>。重要的是,调用必须在 StudentC 范围之外执行。在我们的例子中,调用是从 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 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);
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文