Is this diagram valid?

Consider the following diagram:

Is this diagram valid?
A . No, because a DataType cannot have Associations to a Class.
B . No, because a DataType cannot have Operations.
C . No, because a DataType cannot have Attributes.
D . Yes, it is formally correct.

Answer: A

Explanation:

The provided diagram depicts a DataType named Route with operations, attributes, and associations to a Class named City. In UML, a DataType is a type of classifier that specifies the values that do not have identity (i.e., are not distinguishable from other objects). DataTypes may contain Attributes and Operations, so options B and C are incorrect.

However, DataTypes should not have associations to Classes because DataTypes are meant to be value types without identity, and associations typically imply a relationship between instances (which have identity). Thus, the presence of associations from Route to City is not consistent with the definition of a DataType.

Reference: UML 2.x Superstructure Specification: Sections on Classifiers and DataTypes provide definitions of what constitutes a DataType and what features they can have. They specifically mention that DataTypes are kinds of classifiers that do not have identity and are often used to type attributes.

UML 2.x Infrastructure Specification: This foundational document gives additional context on the semantics of different types of classifiers, including DataTypes, and how they relate to other elements in a UML model.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments