组件图建议框架

component diagram advice framework

我的任务是记录我们的高级软件架构,该架构使用内部开发的机器人框架(类似于 ROS)。我会尽力保持很简单。

在组件图中,我如何表示组件由 class 加载器(基于其在 XML 文件中指定的类型)在提供的基础框架应用程序中实例化并且 运行 在一个单独的线程中?该组件实现并实例化框架提供的服务(即网络通信)。

您可以简单地使用一个 <<instantiate>> 关系,就像本例中取自第 4 页的 UML 2.5 规范中的关系。 39:

In Figure 7.19, the CarFactory Class has a Dependency on the Car Class. In this case, the Dependency is a Usage with the standard stereotype «Instantiate» applied, indicating that an instance of the CarFactory Class creates instances of the Car Class.

请注意,OMG 使用了一些 "artistic" 箭头末端(它们在文档中并不像应有的那样一致)。更常用的是简单的空心三角形。在第39:

A Dependency is shown as a dashed arrow between two model Elements. The model Element at the tail of the arrow (the client) depends on the model Element at the arrowhead (the supplier). The arrow may be labeled with an optional keyword or stereotype and an optional name...

不过,他们使用的线更像是点线而不是虚线。 唉。