Part-Whole Relationship Categories and Their Application in Object-Oriented Analysis
Source: M. Winston R. Chaffin and D.J. Herrmann, "A Taxonomy of Part-Whole Relationships," Cognitive Science,; Vol. 11, 1987, pp. 417-444. A part is one of the segments or portions into which something is regarded as divided; a part is less than a whole; together, parts constitute a whole.
Subcategories of part-whole or meronymic relationships:
category of part-whole relation | example |
---|---|
component/object | processor part-of computer |
member/collection | conductor part-of orchestra |
portion/mass | slice part-of pie |
stuff/object | steel part-of bike |
feature/activity | spoon part-of eating,or swallowing part-of eating |
place/area | Toronto part-of Ontario |
Relations belonging to the same subcategory are more similar in terms of sharing values for three features called relational elements. More precisely, two part-whole relations belong to the same category if and only if they share values for the relational elements functionality, separability, and homogeneity.
Favoring object composition over class inheritance helps you keep each class encapsulated and focused on one task. Designers overuse inheritance as a reuse technique, and designs are often made more reusable (and simpler) by depending more on object composition.
Two Dimensions of Categorization :
- degree of sharing of parts among whole objects and reaches from arbitrary sharing to total exclusiveness.
- degree of dependence between some part object and some whole object(s).
Sharing of Parts Among Whole Objects:
Total exclusiveness
A part-of reference is totally exclusive if there exists exactly one immediate part-of link from a part-type P to a whole-type W and, for each instance p of P, there exists at most one instance w of W such that p part-of w.
In this case, the maximum cardinality on the side of the whole-type is one (whereas the minimum cardinality may be zero or one). Eg: CarEngine part-of Car
Arbitrary sharing
On the other extreme, a part-of reference with no constraint regarding exclusiveness is called shared. Eg: Figure part-of Book, Paper, Documentation
Interclass exclusiveness
A part-of link from P to W is interclass exclusive (interExcl) if there exists exactly one partof link from a part-type P to a whole-type W and if, for each instance p of P, there may exist more than one instance of W : w1; w2; . . . such that p part-of w1, p part-of w2, etc. Eg: windows Message part-of windowsProgram, with the semantics that a windows message may be part of several windows programs, but not of anything else.
Intraclass exclusiveness
A part-of link from P to W is intraclass exclusive, if there may exist further shared or intraclass exclusive links from P to whole-types WX, WY, etc., and, for each instance p of P, there exists at most one instance w of W such that p part-of w. The formalization of this constraint basically amounts to the second line of the total exclusiveness constraint.
Selective exclusiveness
In the case that only a single part-of link may exist, but its whole-type may be chosen among a selection of whole-types W; WX; . . . ; a part-of reference is called selectively exclusive. Eg: Pedal part-of Bicycle or Tricycle.
Degree of Dependence/Independence Among Part- and Whole Objects:
Lifetime dependence
A dependent part-of relationship between a part-type P and a whole-type W is one in which the existence of each part-object pi of type P depends on the existence of one and the same whole-object wi of type W throughout the lifetime of the part-object. Eg: Engine part-of car
Independence
On the other extreme, in an independent part-of relationship between P and W there may exist objects of type P that are not linked to any object of W.
Essentiality
A part-of relationship between a part-type P and a whole-type W is essential or mandatory if each part-object pi of type P must be interconnected to at least one arbitrary whole-object wi of type W. This can be specified by setting the minimum cardinality on the side of the whole-type to one (and refraining from the dependence constraint). Thus, comparing dependence and essentiality, it follows that essentiality imposes a weaker constraint and, hence, forms a prerequisite to (lifetime) dependency. Eg:Module part-ofessential Workspace,
<< Back to Tech Archives |