如何在 UML 序列图中显示实例化? [英] How do you show instantiation in a UML Sequence Diagram?

查看:36
本文介绍了如何在 UML 序列图中显示实例化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何证明 WebServer 实例化了一个视图并重新获得对流的控制权?也许我没有使用正确类型的图表?非常感谢!

How do I show that the WebServer instantiates a View and gets back control of the flow? Maybe I'm not using the right type of diagram? Thanks a bunch!

推荐答案

Ruben 答案中的图表是正确的,但缺少通用的 UML 答案.当创建"线(在本例中为虚线)连接到创建的生命线的框/标签/顶部时,它会创建另一条生命线.来自示例:WebServer 在其操作中创建一个视图,视图完成的操作创建 Widget.

The diagram from Ruben's answer is correct, but general UML answer is missing. It creates the other lifeline when the "create" line (dashed in this case) connects to the box/label/top of the created life line. From example: WebServer in it's action creates a View and the action done by the view creates the Widget.

-----
| a |
-----
  |
  []---->-----
  []     | b |
  |      -----
  |        |

还有几个图表这里.

UML 2.2 规范(上层结构)在第 474 页上有一个示例,图 14.11 是它们的规范语法/符号参考.在第 495 页的符号部分,它声明对象创建消息有一条带空心箭头的虚线." 这在 UML 中进一步定义,因为消息类型是称为 MessageSort 的枚举.一个值是:

The UML 2.2 specifications (superstructure) has an example on page 474, Figure 14.11 is their canonical syntax/notation reference. And on page 495 in the notation section it states "Object creation Message has a dashed line with an open arrow." This is further defined in the UML as the message type is an enumeration called MessageSort. One value is:

"• asynchSignal - 消息是由异步发送生成action.createMessage - 消息指定创建另一个生命线对象."

"• asynchSignal - The message was generated by an asynchronous send action.createMessage - The message designating the creation of another lifeline object."

这篇关于如何在 UML 序列图中显示实例化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆