Site icon Exam4Training

Which statement is always true about this diagram?

Consider the following diagram:

Which statement is always true about this diagram?
A . There are infinitely many H objects inside Pckg.
B . There are between 1 and 5 G objects inside Pckg
C . For every H object, there are fewer than 5 G objects associated with it.
D . There may be an G object which has no H object associated with it through gh.

Answer: D

Explanation:

The diagram shows a package Pckg that includes two classes G and H with a one-to-many association

between them. The multiplicity ‘1..5’ near class G on the ‘gh’ association end suggests that for each H object, there should be between 1 to 5 associated G objects. However, the ‘*’ (multiplicity many) near class H on the ‘gh’ association end indicates that a G object can be associated with zero or more H objects. This implies that it’s possible to have a G object that is not associated with any H object.

Reference: UML 2.x Superstructure Specification: Multiplicity notations and association rules are clearly defined in the UML specifications, which detail the semantics of multiplicities and their implications for object association.

UML 2.x Infrastructure Specification: Further explains the basic constructs of the UML metamodel, which underpin the interpretation of multiplicities in associations.

Exit mobile version