Which of the following statements is correct ?
2016
Which of the following statements is correct ?
- A.
Aggregation is a strong type of association between two classes with full ownership.
- B.
Aggregation is a strong type of association between two classes with partial ownership.
- C.
Aggregation is a weak type of association between two classes with partial ownership.
- D.
Aggregation is a weak type of association between two classes with full ownership.
Attempted by 81 students.
Show answer & explanation
Correct answer: C
Answer: The correct statement is "Aggregation is a weak type of association between two classes with partial ownership."
Explanation:
Aggregation is a weak association where the whole and its parts have independent lifecycles; parts can exist independently of the whole and ownership is partial or shared.
Composition is a strong association that implies full ownership and coincident lifetimes: when the whole is destroyed, the parts are usually destroyed as well.
UML notation: aggregation is represented by a hollow diamond at the whole end; composition is represented by a filled (black) diamond.
How to decide: if the part can exist on its own outside the relationship, it is aggregation; if the part cannot reasonably exist without the whole, it is composition.
Examples: aggregation — a department and its professors (professors can exist independently); composition — a house and its rooms (rooms are integral to the house in the modeled context).
Therefore, statements that call aggregation "strong" or assert "full ownership" are incorrect because those terms describe composition, not aggregation.