Object-Oriented Analysis and Design for Information Systems: Modeling with UML, OCL, and IFML

Category: Programming
Author: Raul Sidnei Wazlawick
This Month Stack Overflow 1


by anonymous   2019-01-13

In general my rule of thumb is that when in doubt, always use association rather than composition/aggregation. My reasons for this are:

(1) In Object-oriented analysis and design for information systems Wazlawick notes that the real advantage of composition and aggregation is that the attributes of the parts are often used to derive attributes of the whole. As an example he mentions that the total value of an order (whole) is derived of the value of each of its items (parts). However, this to him is a design concern rather than a conceptual modelling concern. From a conceptual modelling perspective, he believes that modellers often apply aggregation and composition inappropriately (that is, where whole-part relations are not present) and that their use seldom have real benefit. Hence he suggests avoiding or even abolishing their use.

(2) UML aims to provide a semi-formalization of part-whole relations through composition/aggregation. However, formalization of part-whole relations is a non-trivial task, which the UML specification does not do justice. Indeed, a number of researchers have pointed out various aspects with regards to aggregation and composition in which the UML specification is under specified. All have proposed means for addressing the shortcomings of the UML specification, but to date these changes have not been incorporated into the UML specification. See for instance Introduction to part-whole relations.