Lec 9-12
Lec 9-12
Independence ● In aggregation, the “part” class (the ● In composition, the “part” objects
one contained within the other) can are created and managed by the
exist outside of the “whole” class (the “whole” class.
one containing the part). ● The parts cannot exist without
● The part can have a longer lifespan the whole, and their lifecycles
than the whole, and it may be used are tightly bound to the whole
by multiple instances of the whole object.
class.
Difference between Aggregation and Composition
Property Aggregation Composition