Mark As Completed Discussion

Association vs Composition vs Aggregation

The key difference between association, composition, and aggregation is that composition and aggregation are two forms of association.

Association vs Composition vs Aggregation

The key differences between composition and aggregation are given below:

CompositionAggregation
1Child will co-exist with the container classChild can exist Independently
2Part-of relationship.Has-a relationship
3Stronger form of associationWeaker form of composition
4Can only have one-to-one and many-to-one relationshipCan have a one-to-one, many-to-one, one-to-many and many-to-many relationship
5Composited objects cannot be changed from the referrer.Aggregated objects can be removed or replaced by another same type of object.