Exam4Training

Which keyword indicates that instances of one Classifier may be used instead of Instances of another Classifier?

Which keyword indicates that instances of one Classifier may be used instead of Instances of another Classifier?
A . « substitute»
B . «replacement»
C . «isReplaceable»
D . «isSubstitutable»

Answer: D

Explanation:

In UML, the keyword «isSubstitutable» is used to indicate that instances of one classifier may be used in place of instances of another classifier. This concept is commonly applied in the context of generalization, where a subclass can be substituted for its superclass. The substitutability is a fundamental principle of object-oriented design, particularly in the Liskov Substitution Principle, which states that objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program. This principle is reflected in UML’s support for polymorphism, which is implicit in the generalization relationships between classifiers.

Exit mobile version