I have been reading Design Patterns: Elements of Reusable Object-Oriented Software and got to the part explaining aggregation
and acquaintance
. Here is an excerpt (sorry if it is too long but I deemed all of it to be important to explain this question):
Consider the distinction between object aggregation and acquaintance and how differently they manifest themselves at compile- and run-times. Aggregation implies that one object owns or is responsible for another object. Generally we speak of an object having or being part of another object. Aggregation implies that an aggregate object and its owner have identical lifetimes. Acquaintance implies that an object merely knows of another object. Sometimes acquaintance is called "association" or the "using" relationship. Acquainted objects may request operations of each other, but they aren't responsible for each other. Acquaintance is a weaker relationship than aggregation and suggests much looser coupling between objects. ... Ultimately, acquaintance and aggregation are determined more by intent than by explicit language mechanisms. The distinction may be hard to see in the compile-time structure, but it's significant. Aggregation relationships tend to be fewer and more permanent than acquaintance. Acquaintances, in contrast, are made and remade more frequently, sometimes existing only for the duration of an operation. Acquaintances are more dynamic as well, making them more difficult to discern in the source code.
The confusing part for me is that aggregation
described here has traits of composition
-> composing object contains/manages other objects and their life-cycles are bound.
On the other hand acquaintance
defined in that excerpt has traits of aggregation
-> aggregating object only knows about the objects but it does not manage them.
Also the part
Sometimes acquaintance is called "association" or the "using" relationship.
is confusing as I thought that both aggregation
and composition
are forms of association
with aggregation
being the less coupling one.
Can it be that the authors are referring to aggregation
as acquaintance
and to composition
as aggregation
or am I missing something?