ODX - Aggregation, Composition, Association

Aggregation or composition relationships are used if an object of one class is contained in an object of another class.

 

 

They are drawn as a line with a diamond at the end of the containing class. A composition relationship’s diamond is filled; an aggregation’s diamond is not.

 

 

The difference between these two kinds of relationships is as follows: The contained element in a composition relationship is a part of the containing element: If the containing element is deleted, the contained element no longer exists. Therefore, composition means an object may only be contained in one other object.. An aggregation relationship is one of shared objects. This means, multiple objects may aggrgate the same object. By consequence, an aggregated object still exists, even if the aggregating object is deleted

 

 

If the PERSON no longer exists, nor do the feet. In contrast, a PERSON may also have a lot of COATs. However, a COAT may generally be used by multiple PERSONs and its life-cycle is generally independent of the life-cycle of its wearers.

 

An association relationship has weaker semantics than the composition relationship. Here, both objects have “equal
rights”. An association relationship opens visibility onto the attributes of the related objects. Figure 9 gives an example of an association. In an association objects of one class may be related to one or more objects of the other class. To restrict the number of associations of the same type between two classes, cardinalities are used in the same way as for compositions.

 

 

An Association class is a hybrid of an association and a class. Generally, they can be interpreted as an association carrying its own attributes (and methods). They are drawn like an association with a class symbol being connected to the centre of the association line with a dashed line

 

{xor} constraint: It enforces that an instance of one class has a relationship with instances of one or the other associated class but never both at the same time.

 

In this paragraph, a very short idea of how the UML model is mapped onto XML language elements is given. It does not claim do be complete

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值