IREB_CPRE_FL practice question 10 of 10

You model invoices and invoice items with a UML class diagram. Explanation: The total amount of an invoice is calculated by summing up all individual invoice items. This means that an invoice showing 5 article prices contains 5 invoice items. What model element most accurately describes the relationship between invoice and invoice items? (1 Point)

Full set: 45 questions
Answer options
A: Composition Correct answer
B: Aggregation
C: Generalisation
D: Association
Correct Answer:
A. Composition
Explanation

In UML class diagrams applied in Requirements Engineering (IREB), relationships between classes reflect structural and lifecycle dependencies. A composition is a strong form of aggregation where part objects are existentially dependent on the aggregate (whole) object. In this scenario, an invoice consists of individual invoice items, and the total amount is calculated directly from these items. If an invoice is deleted or does not exist, the individual invoice items lose their structural existence context and cannot exist independently. Therefore, composition (represented by a filled diamond symbol at the whole end) is the most accurate model element to describe the lifecycle-dependent whole-part relationship between an invoice and its constituent invoice items.

Why Incorrect

B. Aggregation: Aggregation represents a weak whole-part relationship where part objects can exist independently without existential dependency on the whole.
C. Generalisation: Generalisation denotes an "is-a" taxonomy or inheritance relationship between superclasses and subclasses, not a whole-part structural relationship.
D. Association: Association is a generic structural connection; composition is far more precise because it specifically denotes mandatory lifecycle and existential dependency.

References

IREB CPRE Foundation Level Syllabus, Version 3.1.0, Section 4.4 "Modelling Requirements with Structural Diagrams".

IREB Handbook Requirements Engineering Foundation Level, Version 1.1, Chapter 4 "Requirements Modelling".

OMG Unified Modeling Language (OMG UML) Specification, Version 2.5.1, Section 11 "Classes".

Scroll to Top