Re: Aggregation vs composition

From: Daniel T. (postmaster_at_eathlink.net)
Date: 04/24/04


Date: Sat, 24 Apr 2004 13:02:06 GMT

Michael Rauscher <michlmann@gmx.de> wrote:

> Daniel T. schrieb:
> > Michael Rauscher <michlmann@gmx.de> wrote:
> >
> >>2. an element that is part of a composition may be included in an
> >>association/aggregation at the same time (in that case there are more
> >>than 1 possible references to the element).
> >
> >
> > Nonsense, if more than one object has a reference to our "part" then no
> > one object "has sole responsibility for the disposition" of that part.
>
> I think, you define a relation to be a composition only if the composite
> hides its parts and acts like a facade for them.

Yes, we must be able to use the "whole" without knowledge of the parts.
The point of composition is that the parts can be ignored

> Consider e.g.
>
> [Organization]<#>------>[OrganizationalUnit]<--------->[Employee]

As long as an employee has a reference to an OrganizationalUnit, the
Organization that the unit belongs to *cannot* destroy the unit. Thus
the Organization does not have control of the disposition of its parts,
thus no Composition relationship exists.

Your example is exactly why the Aggregation relationship exists;
conceptually we want to say that an OrganizationalUnit is part of an
Organization, however the relationship doesn't exhibit the properties of
a true composition relationship.

> In addition, the relation between classes/objects does not depend on the
> concepts, strength or weaknesses of a specific programming language
> (regarding Java one can only set references to null and hope, that the
> garbage collector will destroy the object (and call finalize) as soon as
> possible).

Of course not, pick any other language and the same principle holds
true. In order for object A to have "control of the disposition" of
object B, A must be the only object that has a reference to B. Having
control of the disposition means that A can destroy B at any moment in
time, if this is not true then no composition relationship exists.



Relevant Pages

  • Re: What is this chord in Roman Numerals?
    ... 12-tone and composition techniques in general last weekend, ... Now of course Punk and Intergral Serialism did exist, ... but can you have complete lack of control? ... tries to be 'historical' in one's application of those techniques. ...
    (rec.music.theory)
  • Re: Serial = Random ?
    ... That something in the nature of the process itself, which one believes empowers them to control & order their parameters (whether tonality, rhythm, textures, intensity), actually removes one’s ability at control. ... Any composition method can be used in a variety of ways ... This same thing can happen if you simply follow the rules of tonality ...
    (rec.music.theory)
  • Re: Serial = Random ?
    ... That something in the nature of the process itself, which one believes empowers them to control & order their parameters, actually removes one’s ability at control. ... Any composition method can be used in a variety of ways ... This same thing can happen if you simply follow the rules of tonality ... and you have 12 x 12 x 4 sets of tones to work with. ...
    (rec.music.theory)
  • Re: Demographics in fantasy kingdoms
    ... The average consumer has very little control over what change he gets. ... You can control the _amount_ of change, but not the composition of it. ... if I want a dollar coin). ...
    (rec.arts.sf.written)
  • Re: Aggregation vs composition
    ... Are you saying that the Composition relationship is only ... > It's not of interest in which language you implement a composition. ... Yet you say that Organization is the one in control? ...
    (comp.object)