UML aggregation: how can the “whole” exist without its “parts”?
You are actually confusing aggregation with association.
Aggregation (AKA the having relationship) is a part–whole relationship, meaning that the whole cannot exist without the part. The part is an essential attribute of the whole. E.g. a car (the whole) and its engine (the part) are in aggregation since a car needs its engine to exist.
Association (AKA the acquaintance relationship or using relationship) on the other hand is not a part–whole relationship. One object is an accidental attribute of the other. E.g. a car and its owner are in association since a car does not need its owner to exist.
Note. — As noted by @Christophe, aggregation can be subdivided into two categories (but it is irrelevant to your question which was about general aggregation): shared aggregation where the part can exist without the whole, and composite aggregation (AKA composition, or unique aggregation as I like to call it) where the part cannot exist without the whole.
References
Gamma (Erich), Helm (Richard), Johnson (Ralph), Vlissides (John), Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, Boston, 1994. Relevant excerpt § 1.6, p. 22:
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.
Note. — OMT was published in 1991 and UML in 1997, so the authors use OMT aggregation to refer to UML composite aggregation (AKA composition).
Grogono (Peter), Sakkinen (Markku), “Copying and Comparing: Problems and Solutions”, ECOOP 2000: Object-Oriented Programming, Springer, Berlin, p. 226-250, 2000. Relevant excerpt, § 2.1, p. 228:
We distinguish essential and accidental attributes of an object.{Footnote: This distinction is based loosely on Aristotle’s categories.} An essential attribute is indisputably a part of the object; an accidental attribute is another object that is related in some way to the object in question but is not a part of it. For example, if the object in question is an instance of class Car
, we would consider the attribute engine
to be essential but the basic value distanceTravelled
and the reference owner
to be accidental. The distinction between “accidental” and “essential” is orthogonal to that between “reference” and “containment”. The model permits all four possibilities. When an attribute is represented by a reference, it is the referent object itself, not the reference, that is the accidental or essential attribute.
Accidental attributes are intended as a generalization of associations. An association is a “structural relationship between peers” where “peers” are classes at the same conceptual level. An association is a kind of accidental attribute but it is not the only kind. Associations are usually implemented as references to other full-fledged objects, although more elaborate implementations have been proposed. But objects may also contain counters, flags, descriptors, and other attributes that are needed by the application software but are conceptually not part of the object.
The distinction between essential and accidental is not always obvious. As a rule of thumb, the relationship between two objects is an association (and therefore accidental) if destroying one object does not logically entail destroying the other, otherwise one object is an attribute of the other. Similarly, an attribute is accidental if removing it from the object does not destroy the basic integrity of the object.