UML 箭头的解释 [英] Explanation of the UML arrows

查看:24
本文介绍了UML 箭头的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在研究 UML 并在类之间用普通的纯箭头绘制简单的图表,但我知道这还不够.还有很多其他箭头:概括、实现等,它们对图表读者有意义.

是否有一个很好的资源可以解释每个箭头(普通的、普通的、虚线的、钻石填充的、钻石的)?

最好能有一些代码示例.

解决方案

以下是 Visual Studio 2015 文档中的一些解释:

UML 类图:参考:

<块引用>

协会的属性

聚合:这在连接器的一端显示为菱形.你可以用它来表示聚合角色的实例拥有或包含另一个角色的实例.

Is Navigable:如果仅对一个角色为 true,则会在可导航方向出现一个箭头.您可以使用这表示软件中链接和数据库关系的可导航性.


<块引用>

泛化:泛化意味着特化或派生类型继承属性,一般或基本类型的操作和关联.一般类型出现在箭头处结束关系.

实现:实现是指一个类实现了指定的属性和操作界面.接口在连接器的箭头端.

如果您有更多问题,请告诉我.

I have recently been studying UML and drawing simple diagrams with ordinary plain arrows between classes, but I know it's not enough. There are plenty of other arrows: generalization, realisation and etc. which have meaning to the diagram reader.

Is there a nice resource which could explain each arrow (ordinary, plain, dotted, diamond-filled, diamond)?

It would be the best if it will have some code examples for them.

解决方案

Here's some explanations from the Visual Studio 2015 docs:

UML Class Diagrams: Reference: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/modeling/uml-class-diagrams-reference

5: Association: A relationship between the members of two classifiers.

5a: Aggregation: An association representing a shared ownership relationship. The Aggregation property of the owner role is set to Shared.

5b: Composition: An association representing a whole-part relationship. The Aggregation property of the owner role is set to Composite.

9: Generalization: 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.

13: Import: A relationship between packages, indicating that one package includes all the definitions of another.

14: Dependency: The definition or implementation of the dependent classifier might change if the classifier at the arrowhead end is changed.

15: Realization: The class implements the operations and attributes defined by the interface. Use the Inheritance tool to create a realization between a class and an interface.

16: Realization: An alternative presentation of the same relationship. The label on the lollipop symbol identifies the interface.

UML Class Diagrams: Guidelines: http://msdn.microsoft.com/library/dd409416%28VS.140%29.aspx

Properties of an Association

Aggregation: This appears as a diamond shape at one end of the connector. You can use it to indicate that instances at the aggregating role own or contain instances of the other.

Is Navigable: If true for only one role, an arrow appears in the navigable direction. You can use this to indicate navigability of links and database relations in the software.


Generalization: Generalization means that the specializing or derived type inherits attributes, operations, and associations of the general or base type. The general type appears at the arrowhead end of the relationship.

Realization: Realization means that a class implements the attributes and operations specified by the interface. The interface is at the arrow end of the connector.

Let me know if you have more questions.

这篇关于UML 箭头的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆