我对组件 - 子组件关系感到困惑并且 组件之间的泛化关系。
什么时候我们需要将两个组件称为组件 - 子组件关系以及何时将它们称为泛化关系。
泛化关系(图A)可以一直被称为组件图中的组件-子组件关系(图B)吗? (可以理解逆为假)
图A:
图B:
最佳答案
图
B
中的符号用于表示component realization关系。www.omg.org/spec/UML/2.5/Beta2:
11.6.3 Structured Classifiers → Components → Semantics
...A
Component
may be realized (or implemented) by a number of Classifiers. In that case, aComponent
owns a set ofComponentRealizations
to theseClassifiers
.A component acts like a
Package
for all model elements that are involved in or related to its definition, which should be either owned or imported explicitly. Typically theClassifiers
that realize aComponent
are owned by it...您可以使用generalization组件之间的关系(图
A
)照常,因为组件是 UML classifier就像任何其他类(class)一样。
但是图A
和图B
代表不同的事物,而图B
在你的例子中不行
关于uml - 组件-子组件关系还是泛化关系?在组件图 UML 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28603757/