这很尴尬,我很抱歉没有包括图表图像(我以为我包括了它,但我应该更加小心并在帖子中验证它)
我对UML几乎一无所知,但据我所知,一个空头的箭头表示继承关系(即ANDSpecification
类继承自CompositeSpecification
类),而另一种类型箭头告诉我们可以从 ANDSpecification
导航到 CompositeSpecification
?
a) 但是为什么连接 ANDSpecification
和 CompositeSpecification
的图包含两种类型的箭头?或许是因为除了 ANDSpecification
继承自 CompositeSpecification
之外,它还有一个 CompositeSpecification
类型的属性?
b) 箭头旁边的数字是什么意思?
最佳答案
首先,能否请您提供您的类图实现的来源,您的输入不够清晰,无法确定类之间的关系。
- (A) 有两种类型的箭头,长方形箭头表示“泛化”。
The specific classifier inherits part of its definition from the general classifier. The general classifier is at the arrow end of the connector. Attributes, associations, and operations are inherited by the specific classifier. Use the Inheritance tool to create a generalization between two classifiers.
- 第二种箭头描述的是“Association”
A relationship between the members of two classifiers. There are two types of it, Aggregation and Composition.
- (B) 箭头旁边的数字简单描述了“多重性”
Multiplicity of an association end is the number of possible instances of the class associated with a single instance of the other end.
┬─────────────────────────┬───────────────────────────────────────────────────────┬
│ Multiplicities | Explanation |
│ | |
├─────────────────────────┼───────────────────────────────────────────────────────┼
|0..1 | zero or one instance. |
├─────────────────────────┼───────────────────────────────────────────────────────┼
|0..* or * | no limit on the number of instances (including none) |
├─────────────────────────┼───────────────────────────────────────────────────────┼
|1 | exactly one instance |
├─────────────────────────┼───────────────────────────────────────────────────────┼
|1..* | at least one instance |
├─────────────────────────┼───────────────────────────────────────────────────────┼
您可以在下面的链接中找到有用的示例。
http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx
关于uml - 有人可以解释这个UML图吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14529185/