There is always been confusion about composition and aggregation. While in servicing NetSol Technologies, I came to learn practically what is composition and aggregation. First thing is both are type of association. Below is the exact definition of each term and then practical Java code, where you can understand exactly how can we implement composition and aggregation in programming.
Composition: Life time of objects got to be the same. For example there is a composition between car-frame and a car. If the car gets destroyed the car-frame would also get destroyed.
Aggregation: Life times of the objects are not the same, one object can live even after the other object has been destroyed.



















Excellent explanation with very good example.