文档详情

基本架构建模关联的术语和概念(二).doc

发布:2018-08-26约6.3千字共9页下载文档
文本预览下载声明
Associations 联合 An association is a structural relationship that specifies that objects of one thing are connected to objects of another. Given an association connecting two classes, you can relate objects of one class to objects of the other class. It’s quite legal to have both ends of an association circle back to the same class. This means that, given an object of the class, you can link to link to other objects of the same class. An association that connects exactly two classes is called a binary association. Although it’s not as common, you can have associations that connect more than two classes; these are called n-ary associations. Graphically, an association is rendered as a solid line connecting the same or different classes. Use associations when you want to show structural relationships. Beyond this basic form, there are four adornments that apply to associations. 联合是一个结构关系,它描述一个事物的对象连接另一个事物的对象.给定一个关联连接两个类,你能建立一个类的对象和另一个类的对象之间的联系.一个联合的一端从一个类出发而另一端又回到这个类的关联是符合规则的.连接两个类的联合被称为二元联合.尽管不是很常见,但是可以有连接超过两个类的联合;这被称为n级联合.图形显示上,联合表现为一条连接相同或不同的类的实线.在你想显示结构关系时使用联合.除了基本形式,还有四个修饰适用于联合. Name An association can have a name, and you use that name to describe the nature of the relationship. So that there is no ambiguity about its meaning, you can give a direction to the name by providing a direction triangle that points in the direction you intend to read the name, as shown in Figure 5-4. 名称:一个联合可以有名称.使用这个名称以描述关系的特征,以便对它的含义没有歧义.你能通过带有方向的三角形给名称提供方向,以指出从哪边开始读名称,如图5-4显示的. Note: Although an association may have a name, you typically don’t need to include one if you explicitly provide end names for the association. If you have more than one association connecting the same classes, it is necessary to use either association names or association end names to distinguish them. If an association has more than one end on the same class, it is necessary to use association end names to distinguish the ends. If there is only one association between a pair of classes, some modelers omit t
显示全部
相似文档