Composition and aggregation?

Hi friends,
i want to know the exact difference between composition and aggregation?
i searched in google and i got so many answers…
but still i didnt understand it clearly…
can anybody give me some programmatic example(with programs)??
Thanks in advance

Hi user,

Thanks for your post. An aggregation represents a “has-a” / “part-of” relationship. Composition is a stronger form of aggregation, it implies that a composite object has exclusive ownership of the parts object. You can refer to the image below about the relationships represented by aggregation and composition.

Hope this helps. If there is further inquiry, please do not hesitate to contact me.

Best regards,
Lilian Wong
aggregation_composition.png