0

enter image description here

This is embarrassing, I apologize for not including the diagram image ( I thought I included it, but I should be more careful and verify it in the post )

I know almost nothing about UML, but to my knowledge an arrow with hollow head represents inheritance relationship ( ie ANDSpecification class inherits from CompositeSpecification class ), while the other type of arrow tells us we can navigate from ANDSpecification to CompositeSpecification?

a) But why does the diagram connecting ANDSpecification and CompositeSpecification contain both types of arrows? Perhaps because in addition to ANDSpecification inheriting from CompositeSpecification, it also has a property of type CompositeSpecification?

b) What is the meaning of numbers next to arrows?

4

1 回答 1

5

首先,您能否提供您的类图实现的来源,您的输入不够清楚,无法确定类之间的关系。

  • (A) 有两种类型的箭头,带有矩形头部的箭头描述“泛化”。

特定分类器从通用分类器继承其定义的一部分。通用分类器在连接器的箭头端。属性、关联和操作由特定的分类器继承。使用继承工具在两个分类器之间创建泛化。

  • 第二种箭头描述“关联

两个分类器的成员之间的关系。它有两种类型,聚合和组合。

  • (B) 箭头旁边的数字简单地描述了“多重性

关联端的多重性是与另一端的单个实例相关联的类的可能实例的数量。

  ┬─────────────────────────┬───────────────────────────────────────────────────────┬
  │  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                                 | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼

您可以在下面的链接中找到有用的示例。

UML 箭头的解释

http://msdn.microsoft.com/en-us/library/dd409437%28VS.100%29.aspx

http://edutechwiki.unige.ch/en/UML_class_diagram

于 2013-01-25T21:20:21.660 回答