uml - 有人可以解释这个UML图吗

标签 uml class-diagram

enter image description here

这很尴尬,我很抱歉没有包括图表图像(我以为我包括了它,但我应该更加小心并在帖子中验证它)

我对UML几乎一无所知,但据我所知,一个空头的箭头表示继承关系(即ANDSpecification类继承自CompositeSpecification类),而另一种类型箭头告诉我们可以从 ANDSpecification 导航到 CompositeSpecification

a) 但是为什么连接 ANDSpecificationCompositeSpecification 的图包含两种类型的箭头?或许是因为除了 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                                 | 
  ├─────────────────────────┼───────────────────────────────────────────────────────┼

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

Explanation of the UML arrows

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

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

关于uml - 有人可以解释这个UML图吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14529185/

相关文章:

java - Eclipse Indigo (3.7) 的免费 UML 插件?

eclipse - 最佳 Eclipse UML 插件

interface - uml 中的类与接口(interface)

rest - 如何在 UML 中将属性显示为 "readonly"?

iphone - 为 iPhone 应用程序生成类图

java - Java 伪代码中所附 UML 图的解释?

cassandra - 将规则从 UML 映射到面向列的 NoSQL 数据库

c++ - 模拟器的状态机

servlets - 在 UML 类图中仅用一个类来表示多个类

javascript - 在 JavaScript 游戏中组织类