[英]UML Class Diagram — Multiplicity for Inheritance
My understanding is that, in UML class diagrams, inheritance is a particular kind of association. 我的理解是,在UML类图中,继承是一种特殊的关联。
An association can have a multiplicity. 关联可以具有多重性。
However, it seems that inheritance is never represented with a multiplicity. 但是,似乎继承永远不会用多重性来表示。
Why? 为什么? Is it because the multiplicity is always 1..1
and 0..1
(example below)? 是因为多样性始终是1..1
和0..1
(下面的示例)吗?
inheritance is a particular kind of association 继承是一种特殊的关联
This is a fundamental misunderstanding. 这是一个根本的误解。 Generalization (aka inheritance) is a particular kind of relationship but it is not an association . 泛化(即继承)是一种特殊的关系,但不是关联 。
Thus there is no multiplicity for it. 因此,没有多重性。 Also as already mentioned it would make no sense to have one. 同样正如已经提到的,拥有一个没有意义。
Generalization is on a class level. 泛化在类级别上。 If a class B is a specialized class of class A, then all elements that are of type B are at the same type also of type A. 如果类B是类A的专门类,则所有类型B的元素也都属于类型A。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.