Free OMG-OCUP2-ADV300 Exam Braindumps (page: 8)

Page 7 of 24

Choose the correct answer :
Which can be added to a redefined operation?

  1. scope
  2. templates
  3. parameters
  4. preconditions

Answer(s): D

Explanation:

In UML, operations can have preconditions defined, which are constraints that must be true before the operation is invoked.
When an operation is redefined in a subclass, it is possible to add new preconditions or alter existing ones. Redefining an operation does not typically allow for changes to its scope or the addition of templates, but the preconditions may be expanded to reflect the semantics of the subclass. This is in line with the behavioral specification of operations in UML, where preconditions are part of the behavioral contract of an operation, as described in the UML 2.x Superstructure Specification.



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.






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

OMG-OCUP2-ADV300 Discussions & Posts