Which of the following is a correct statement ?

2016

Which of the following is a correct statement ? 

  1. A.

    Composition is a strong type of association between two classes with full ownership.

  2. B.

    Composition is a strong type of association between two classes with partial ownership.

  3. C.

    Composition is a weak type of association between two classes with partial ownership.

  4. D.

    Composition is a weak type of association between two classes with strong ownership.

Attempted by 224 students.

Show answer & explanation

Correct answer: A

Key idea: Composition is a strong form of association where the whole has exclusive ownership of its parts; the parts' lifecycles are bound to the whole.

  • Definition: In composition, one class (the whole) exclusively owns instances of another class (the part). The part cannot meaningfully exist without the whole.

  • Lifecycle rule: When the whole is destroyed, its composed parts are typically destroyed as well.

  • UML notation: Composition is shown with a filled (black) diamond at the whole end of the association.

  • Example: A house composed of rooms — the rooms are considered part of that specific house and are tied to the house's existence in the composition relationship.

  • Contrast with aggregation: Aggregation is a weaker form of association representing shared or partial ownership; parts can often exist independently of the whole and aggregation is shown with an open (white) diamond.

Conclusion: The correct statement is that composition is a strong type of association with full/exclusive ownership and tied lifecycles.

Explore the full course: Mppsc Assistant Professor