Difference between aggregation and association
Answers
Answered by
5
Hi mate here is ur answer!
Association is a relationship where all objects have their own lifecycle and there is no owner.
Let's take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers, but there is no ownership between the objects and both have their own lifecycle. Both can be created and deleted independently.
Aggregation is a specialised form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.
i hope it helps u buddy ✌✌
Association is a relationship where all objects have their own lifecycle and there is no owner.
Let's take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers, but there is no ownership between the objects and both have their own lifecycle. Both can be created and deleted independently.
Aggregation is a specialised form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.
i hope it helps u buddy ✌✌
Answered by
0
*.Associationis a relationship where all objects have their own lifecycle andthere is no owner.
Let's take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers, but there is no ownership between the objects and both have their own lifecycle. Both can be created and deleted independently.
*.Aggregationis a specialised form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.
Let's take an example of Department and teacher. A single teacher can not belong to multiple departments, but if we delete the department, the teacher object willnotbe destroyed. We can think about it as a “has-a” relationship.
Let's take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers, but there is no ownership between the objects and both have their own lifecycle. Both can be created and deleted independently.
*.Aggregationis a specialised form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.
Let's take an example of Department and teacher. A single teacher can not belong to multiple departments, but if we delete the department, the teacher object willnotbe destroyed. We can think about it as a “has-a” relationship.
Attachments:
Similar questions