首页 > 代码库 > UML基本架构建模--关联的术语和概念(三)

UML基本架构建模--关联的术语和概念(三)


 

Other Features

其它特征

 

Plain, unadorned dependencies, generalizations, and associations with names, multiplicities, and roles are the most common features youll need when creating abstractions. In fact, for most of the models you build, the basic form of these three relationships will be all you need to convey the most important semantics of your relationships. Sometimes, however, youll need to visualize or specify other features, such as composite aggregation, navigation, discriminants, association classes, and special kinds of dependencies and generalizations.these and many other features can be expressed in the UML, but they are treated as advanced concepts.

朴实无华,未经修饰的依赖关系,泛化关系和带有名称,多态性和角色的联合关系是你在创建抽象事物时所需的最普通的特性.事实上,你构建的大多数模型,这三个关系的基本形式将是你传达已有关系的最重要语义.然而,有时你需要可视化或是描述其它的特性,如复合聚合,导航,判断,关联类和特殊类别的依赖和泛化关系.这些和许多其它特性可以在UML中被表达出来,但是它们属于更深层的概念.

 

Dependencies, generalizations, and associations are all static things defined at the level of classes. In the UML, these relationships are usually visualized in class diagrams.

依赖,泛化和联合都是在类层面上定义静态事物.在UML中,这些关系通常被画在类图中.

 

When you start modeling at the object level, and especially when you start working with dynamic collaborations of these objects, youll encounter links, which are instances of associations representing connections among objects across which messages may be sent.

当你开始在对象层建模时.尤其是当你开始工作在这些对象之间的动态交互时,你会遇到很多联系,它们是关联的实例,表现的是对象之间的连接,这种连接可能是消息的发送.

 

Drawing Styles

绘画风格

 

Relationships are shown in diagrams by lines from one icon to another. The lines have various adornments, such as arrowheads or diamonds, to distinguish different kinds of relationships. Typically, modelers choose one of two styles for drawing lines:

1.Oblique lines at any angle. Use one line segment unless multiple segments are needed to avoid other icons.

2.Rectilinear lines drawn parallel to the sides of the page. Unless a lines connects two icons that align, the line must be drawn as a series of line segments connected by right angles. This is the style mostly used in this book.

 关系在图中被显示为从一个图标到另一个图标的直线.这些线有多种修饰,如箭头或是菱形,以区分不同类别的关系.最典型地,建模选择两种风格的画线:

1.任何角度的斜线.除非为了避开其它图标而使用多个线段,否则使用一个线段.

2.直线的绘制平行于页面的两侧.除非一个线条连接的是两个排列整齐的图标,否则这个线条就画成直角相连的一系列线段.在这本书里这种格式是最常用的.

 

With care, most line crossings can be avoided. If a line crossing is necessary and there is ambiguity about how the paths are connected, a small arc can be used to indicate a line crossing.

注意,大多数的线条是可以避免交叉.如果一个交叉线不可避免,这里的路径是如何连接的就会产生歧义.一个小弧形被用作指示一个交叉线.

技术分享

UML基本架构建模--关联的术语和概念(三)