association
Association is a relationship in which all objects have their own life cycle, and they do not have an owner. Let’s take an example of a Teacher and a Student. Several students can communicate with one teacher, and one student can communicate with several teachers, but there is no property right between the objects, and both have their own life cycle. Both can create and delete independently.
aggregation
objects in the Aggregation have their own life cycle, but there is property. A child cannot belong to another parent. Let's take an example of a pulpit and a teacher. One teacher cannot belong to several departments, but if we remove the teacher, the object will not be destroyed. We can think of an “eat” relationship.
Composition
This is a strong type of aggregation. A child object does not have its life cycle, and if the parent object deletes all child objects, they will also be deleted. Let us again take an example of the relationship between the House and the rooms. A house can contain several rooms, there is no independent living room, and any room cannot belong to two different houses, if we delete the house, the room is automatically deleted.
Santosh
source share