OMG-OCUP2-ADV300 practice question 1 of 10

Where does UML explicitly intend String Expression elements to be used?

Full set: 90 questions
Answer options
A: as (he ValueSpecifications for the nameExpressions of ParameterableElements within Template spe ci ficati ons Correct answer
B: as the model the author chooses for the specification of custom dynamically-generated names for any NamedElement
C: whenever an OpaqueExpression form of a ValueSpecification needs to specify an expression that operates on String instances
D: The specification has no metaclass StnngExpression and so no use of StringExpression is explicitly intended.
Correct Answer:
A. as (he ValueSpecifications for the nameExpressions of ParameterableElements within Template spe ci ficati ons
Explanation

In the Unified Modeling Language (UML) specification, a StringExpression is a specialized ValueSpecification used to compute dynamic names via string manipulation and parameter substitution. Specifically, UML defines StringExpression to be used as the value specification for the nameExpression property owned by NamedElement (and by extension ParameterableElement) when elements are part of template specifications. During template instantiation, the StringExpression evaluates expressions that incorporate template parameters to dynamically generate the resulting element names. Because ParameterableElements within template specifications rely on nameExpression to determine their names upon binding, UML explicitly intends StringExpression elements to serve as the ValueSpecifications for these nameExpressions within template definitions.

Why Incorrect

B: UML explicitly restricts StringExpression usage to nameExpression properties within templates rather than allowing arbitrary, custom dynamically-generated name specifications for any general NamedElement. C: StringExpression is a concrete subclass of Expression (and ValueSpecification), not a form of OpaqueExpression, which uses body strings and languages for general evaluation. D: StringExpression is a valid, standard metaclass defined in the UML specification (under the Expressions and Templates packages).

References

1. Object Management Group (OMG). "OMG Unified Modeling Language (OMG UML), Version 2.5.1." Section 7.4.4 (StringExpression) and Section 9.2 (Templates), pp. 71-73, 105-108.

2. Object Management Group (OMG). "OMG Unified Modeling Language (OMG UML), Superstructure, Version 2.4.1." Section 7.3.55 (StringExpression), pp. 143-144.

Scroll to Top