Originally posted by Mikey Alleblas:
I think an aggregation is redundant.
A composition on the other hand is a strong association between the whole and its parts. When the whole class terminates, so do its parts. I think this wuold relate to programming as the instances of the "parts" classes being created within the "whole" object itself.
Originally posted by sarah Marsh:
I didn't get what the followings mean. Please explain more or give one example. Thanks!
The composite is also allowed to pass the responsibility for its parts to other composites. It's important, though, that there is always exactly one composite responsible for a part.
In spite of the few semantics attached to aggregation, everybody thinks it is necessary (for different reasons). Think of it as a modeling placebo. The UML Reference Manual Aggregation pg 148
Originally posted by Warren Dew:
I would use "composition" to include data members that are not shared with other objects.