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

Page 8 of 24

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.



Choose the correct answer :
What characterizes the generalization relationship between two Classifiers where the child can NOT be substituted for the parent?

  1. It has the stereotype "nonSubstitutable".
  2. It has the property "Substitute" set to false
  3. It has the property `'isSubstitutable" set to false.
  4. It has the property "substitutingClassifier" set to false.

Answer(s): C

Explanation:

In UML, the isSubstitutable property of a generalization relationship indicates whether instances of the child classifier can be used wherever instances of the parent classifier are expected, that is, whether the subclass is substitutable for the superclass.
When this property is set to false, it means that the child classifier cannot be substituted for the parent classifier. This property is part of the UML metamodel for generalization and affects how inheritance is interpreted in terms of substitutability, as described in the UML 2.x Superstructure Specification.



Choose the correct answer :
Consider the following diagram fragment:



Which statement is correct?

  1. The set named "b" is contained in a set named "part".
  2. The set named "b" has one subset, that contains the parts of
  3. The property "subsets part" specifies that b only partially defines A
  4. The constraint limits the elements of b to be from a predefined set of parts

Answer(s): A

Explanation:

In UML, the {subsets} keyword is used to indicate that one property is a subset of another property. In the provided diagram fragment, the association end -b {subsets part} indicates that the property b on class A is a subset of the property part on class B. This means that the elements associated with A through b are contained within the larger set associated with B through part. This kind of relationship is typically used in more complex class models where a part-whole hierarchy is represented, and it allows the model to show that certain associations are more specific subsets of a more general association. This usage is explained in the UML 2.x Superstructure Specification, where the semantics of association subsets are defined.






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

OMG-OCUP2-ADV300 Discussions & Posts