OOP Assignment Solution

No Comments
Association is a relationship where all object 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
Aggregation : It indicates a “whole/part” relationship.
For example a department of the faculty has instructors.
Parts ( instructors ) can still exist even if the whole ( the department ) does not exist.

Composition : Composition is a strong kind of aggregation where the parts cannot exist independently of the “whole” object.
For example “ A human has head ”

Here head cannot be as a single part. Hence it is said to be a composition.
The relations among them are given as,


Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment