Reputation: 728
I'm a bit confused about which one it is.
You could say it 'uses' the object via the pointer - therefore association. But it also sounds like aggregation - 'has an' object but when this object dies that doesn't mean the referenced object dies.
Which one makes most sense in UML?
Upvotes: 2
Views: 956
Reputation: 6987
It can indicate association, aggregation and event composition. The difference between the three is semantic and not static or implementation specific.
But UML leaves a LOT of space for different interpretations, so you will never get a "correct" answer here.
Upvotes: 1
Reputation: 12398
First, an "aggregation relationship" is actually a (binary) association where one end has an aggregation kind other than "none". Then aggregations are just associations with refined semantics.
Aggregations can be composite (full diamond) or shared (hollow diamond). A composite aggregation means that "the composite object has responsibility for the existence and storage of the composed objects" (then the referenced object dies when the composite is deleted, but a part may be removed before the composite is deleted).
A shared aggregation, on the other hand, does not tie the lifecycle of the aggregated object (the UML specification says that "precise semantics of shared aggregation varies by application area and modeler" and "the precise lifecycle semantics of aggregation is a semantic variation point"). They are something in the middle between an unadorned association and a composite one.
Upvotes: 1