Free OMG-OCUP2-ADV300 Exam Braindumps
OMG Certified UML Professional 2 (OCUP 2) - Advanced Level Questions 26–30 (page: 7)

Updated On: 10-Feb-2026

Choose the correct answer :
Which UML element specifies a set of formal parameters that will be substituted by actual parameters?

  1. template parameter
  2. template signature
  3. templateable element
  4. template parameter substitution

Answer(s): B

Explanation:

A template signature in UML specifies a set of formal parameters that can be substituted by actual parameters when a template is instantiated. This template signature is part of a templateable element, which is the element that can be parameterized using the template mechanism in UML. The template signature defines the formal template parameters that will be replaced by actual values or types when a bound element is created from the template. This concept is detailed in the UML 2.x Superstructure Specification, particularly in the sections describing templates and how they are used to create reusable and customizable model elements.



Choose the correct answer :
Which keyword indicates that instances of one Classifier may be used instead of Instances of another Classifier?

  1. « substitute»
  2. «replacement»
  3. «isReplaceable»
  4. «isSubstitutable»

Answer(s): 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.



Choose the correct answer :
What is true about the use of a Template Classifier to specify the Type of a Typed Element?

  1. The Template Classifier needs to be modeled
  2. The Template Classifier must have defaults for all of its Template Parameters
  3. The Type Property of the Typed Element must directly name the Template Classifier.
  4. Template Classifiers cannot be used in the specification of Types for Typed Elements.
  5. A set of bound elements provides values for the Template Parameters of the Template Classifier.

Answer(s): E

Explanation:

When a template classifier is used to specify the type of a typed element, the actual parameters for the template classifier's formal parameters must be provided by a set of bound elements. This means that for a template classifier to be used as a type, there must be a corresponding binding that specifies what elements are used as arguments for its template parameters. This allows the typed element to have a concrete type that is a specific instantiation of the template classifier with particular values for its template parameters. This use of template classifiers is described in the UML 2.x Superstructure Specification, which details how template binding works to create specific instances of template classifiers.



Choose the correct answer :
Consider the following template Operation:
addElement <E> (e : E)
Which Operation represents a binding of that template Operation?

  1. addElement (e : Card)
  2. addElement <e : Card>
  3. addElement« E -> Card » (e : Card)
  4. addElement «bind» E -> Card (e)

Answer(s): A

Explanation:

The correct representation of a binding of the template operation addElement<E> with E being bound to the type Card is addElement (e : Card). This notation means that the template parameter E is being replaced by the concrete type Card, thus instantiating the template operation with that specific type. In UML, this instantiation does not require the «bind» keyword or the template brackets <> around the type in the operation signature itself; it is simply represented by using the concrete type as the type of the parameter in the operation. This usage is consistent with the UML

2.x Superstructure Specification, which explains how operations of a template classifier are instantiated when template parameters are bound to actual types.



Choose the correct answer :
Consider the following diagram:



What could be substituted for myTypel?

  1. Number
  2. Short or Long
  3. any subtype of Number
  4. any Type, there is no restriction

Answer(s): C

Explanation:

In the given diagram, myType1 is shown redefining prop1, which was originally of type Integer. Given that Integer is a subtype of Number, and myType1 is used in a redefinition context, it implies that myType1 must also be a subtype of Number. In UML, when a property is redefined, the redefining property must be type compatible with the property it redefines. Therefore, myType1 could be substituted by any subtype of Number, which includes Integer, Real, and all their subtypes (Short, Long, Float, Double, etc.). This is based on the UML principle of type conformance in property redefinition, as specified in the UML 2.x Superstructure Specification.



Viewing page 7 of 19
Viewing questions 31 - 35 out of 90 questions


Post your Comments and Discuss OMG OMG-OCUP2-ADV300 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!