Association vs Aggregation vs Composition
Association
- Defines relation between two objects
- All entities are different from each other
- For example, if Ram is friend of Shayam, Shayam is friend of Hari. All three are different individuals.
Aggregation
- Aggregation is subset of association, where the relation between the objects is more compared to association.
- Ripened fruits and seeds, fruit use seed for next generation
- It can be thought as one entity using the other
Composition
- Composition is also subset of association where bonding or relation is maximum
- One entity cannot exist if the host is not available
- For example, one room cannot become part of another house, room doesn’t exist if the house is demolished.
- It’s also called death relationship.
Another metaphor can be, child in mother’s womb is
composition, dependent child or infant is aggregation, adult child and mother
is association. The dependency of the child on the mother gradually decreases
as the child grows from birth to adult hood.
In UML, the
Association is defined by
--------->
Aggregation is defined by ---------<>
Composition is defined by ---------<filled>
For full video visithttps://www.youtube.com/watch?v=5-_cud4pOp8&feature=youtu.be
Comments
Post a Comment