Aggregation vs composition: In UML notation, does a filled (solid) diamond at the aggregate end denote composition, a stronger form of aggregation with whole–part lifetime dependency?

Difficulty: Easy

Correct Answer: Correct

Explanation:


Introduction / Context:
Understanding the visual difference between aggregation and composition in UML helps teams communicate whole–part relationships precisely. Misinterpreting the diamond glyph can reverse the intended semantics, leading to incorrect assumptions about object ownership and lifetime.


Given Data / Assumptions:

  • We focus on UML association adornments at the aggregate end.
  • We distinguish shared aggregation from composition.
  • We consider typical object lifetime semantics.


Concept / Approach:
In UML, an empty (hollow) diamond represents shared aggregation, a weak whole–part relationship (the part may exist independently). A filled (solid) diamond represents composition, a strong whole–part relationship that usually implies the part’s lifetime is bound to the whole. For example, a House composed of Rooms uses a filled diamond at the House end. Thus, the statement correctly identifies the solid diamond as composition.


Step-by-Step Solution:

Identify the association with a diamond at one end.Check whether the diamond is filled (composition) or hollow (shared aggregation).Interpret the lifetime and ownership semantics accordingly.Conclude the statement is correct: filled equals composition.


Verification / Alternative check:
Review canonical UML examples: Document–Page (composition); Team–Player (shared aggregation) where players can exist outside a specific team. Modeling tools and reference cards consistently apply this convention.


Why Other Options Are Wrong:

  • “Incorrect,” “filled denotes shared,” or “empty denotes composition” invert the standard.
  • “Diamonds are deprecated” is false; while usage is sometimes debated, the symbols remain part of UML.


Common Pitfalls:
Overusing aggregation where a plain association suffices; assuming composition enforces physical containment rather than conceptual ownership and lifetime binding.


Final Answer:
Correct

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion