Black Friday week: every question bank $9 instead of $15. Ends Monday, Nov 30.
OCUP 2 Advanced · OMG · Alf · Bank updated 2026-11-28
OMG OCUP 2 Advanced (UML 2 Advanced) practice questions: Alf
5 free questions from 14 on this area · answer and explanation for each · no sign-up
These 5 questions come from the Alf section of ExamDeck's OMG OCUP 2 Advanced (UML 2 Advanced) bank: 14 of its 172 original questions are on this area, which carries 6% of the real exam. Each is open without sign-up, with the correct answer, the reasoning for every option and its source. In all, 65 OMG OCUP 2 Advanced (UML 2 Advanced) questions are open on the practice pages; a free account adds 6 more in study mode.
Questions on this page last changed 28 Nov 2026. Exam facts checked 8 Nov 2026.
Free: 6 questions in study mode, no card. All 14 Alf questions and the full OCUP 2 Advanced bank: $9 (regularly $15) one-time.
How this bank fits the current exam. The bank has questions in all eleven of OMG's areas, but not yet in the exam's proportions: Common Structure (21% of the exam), The MOF & Metamodeling (12%) and Interactions (9%) are covered more thinly than their weight. Our questions come only from the open OMG specifications - UML 2.5.1, MOF 2.5.1, fUML 1.5 and Alf 1.1 - not from the books on the info sheet's study list.
The full exam blueprint →
Source: OMG UML 2 Advanced exam info sheet
1/5 · Alf · hard
A code generator maps Alf text to a target language in which every name must be a plain identifier. The tool may treat some distinct Alf names as conflicting. Which pair of distinct names may it treat as conflicting?
A. 'order total' and 'order-total'
B. identifiers orderTotal and ordertotal
C. 'order total' and 'order_total'
D. 'order$total' and 'ordertotal'
Answer: A. Section 7.6 lets an implementation treat different names as conflicting but fixes minimum rules. Different identifiers never conflict. The corresponding identifier of an unrestricted name gets a leading underscore and loses characters other than letters, digits, underscore and dollar sign. If these differ, no conflict. 'order total' and 'order-total' both give the same result, so a conflict is allowed.
- A. Prepending an underscore and removing the non-alphanumeric characters gives the same corresponding identifier for both, so a conflict is permitted.
- B. Two different identifiers never conflict, and letter case is significant in names.
- C. The underscore is kept, so the corresponding identifiers differ and the names do not conflict.
- D. The dollar sign is kept, so the corresponding identifiers differ and the names do not conflict.
Source: OMG Action Language for Foundational UML (Alf) 1.1 (formal/2017-07-04), 7.6 · Alf / 7.6 Names / corresponding identifier and name conflicts
2/5 · Alf · hard
A team plans to write class and activity definitions entirely in Alf, as standalone model units, rather than only embedding action snippets in a graphical UML model. Their tool vendor states that the product supports Full Conformance. What follows for this plan?
A. Full Conformance requires processing the structural syntax of Clause 10
B. Structural syntax is outside Full Conformance and needs Extended Conformance
C. Class definitions need Extended Conformance but standalone activities need only Full
D. Full Conformance includes structural syntax if the tool executes by compilation
Answer: B. Alf 2.2 defines three syntactic levels. Full Conformance processes all syntax of Clauses 8 and 9 and none of Clause 10, while Extended Conformance adds the structural modeling syntax of Clause 10. Standalone class definitions therefore need Extended Conformance. How the tool executes text (2.3) does not change the syntactic level.
- A. Wrong: Full Conformance covers all syntax of Clauses 8 and 9 but none of Clause 10, which holds the structural modeling syntax (2.2).
- B. Correct: per 2.2, only Extended Conformance adds the structural modeling capabilities of Clause 10 to the action language capabilities.
- C. Wrong: the split is by clause, not by element kind; the structural syntax for model units sits in Clause 10, which Full Conformance excludes (2.2, 6.2).
- D. Wrong: syntactic conformance levels and the ways of execution (interpretive, compilative, translational) are separate aspects (2.1, 2.3).
Source: OMG Action Language for Foundational UML (Alf) 1.1 (formal/2017-07-04), 2.2 · Alf / 2.2 Syntactic Conformance / Full versus Extended Conformance
3/5 · Alf
In a class model, a modeler writes the default value of a property as an Alf instance creation expression. How does Alf treat the explicit type annotation of that expression in this position?
A. The explicit type annotation is required, as in any other expression
B. The type is inferred for primitive-typed properties but not class-typed ones
C. Defaults accept primitive literals but not instance creation expressions
D. A special syntactic form lets the expression omit the explicit type annotation
Answer: D. Alf 6.2 states that an Alf expression may be used anywhere a UML value specification is allowed. For default values of properties or parameters, special syntactic forms for instance creation and sequence construction avoid the redundant explicit type annotation.
- A. Wrong: 6.2 provides special syntactic forms that avoid redundant type annotation for default values.
- B. Wrong: 6.2 does not split by kind of property type; the special forms apply to instance creation and sequence construction in default values.
- C. Wrong: 6.2 says an Alf expression may be used wherever a UML value specification is allowed, and defaults are named explicitly.
- D. Correct: 6.2 describes special forms of instance creation and sequence construction expressions for defaults of properties or parameters, without redundant type information.
Source: OMG Action Language for Foundational UML (Alf) 1.1 (formal/2017-07-04), 6.2 · Alf / 6.2 Integration with UML Models / Alf expressions as value specifications
4/5 · Alf
Line terminators in Alf input text normally count as white space. For which pair of constructs is a line terminator syntactically significant instead?
A. End-of-line comments and in-line comments
B. Annotation lists and in-line statement headings
C. Documentation comments and string literals
D. End-of-line comments and statement annotation lists
Answer: B. Alf 7.4 states that there are two cases in which the line terminator is not treated as white space: a statement annotation list, which starts with the token //@, and the heading of an in-line statement, which starts with /*@. Each must end in a line terminator.
- A. Wrong: 7.4 names only two exceptions, and these comment kinds are not among them; comments are stripped as lexical comments (7.5.2).
- B. Correct: 7.4 says an annotation list beginning with //@ and an in-line statement heading beginning with /*@ must each end in a line terminator.
- C. Wrong: documentation comments allow line terminators inside them (7.5.3) and neither construct is an exception in 7.4.
- D. Wrong: half right; the annotation list is an exception, but the second exception is the in-line statement heading, not the end-of-line comment (7.4).
Source: OMG Action Language for Foundational UML (Alf) 1.1 (formal/2017-07-04), 7.4 · Alf / 7.4 White Space / Line terminators not treated as white space
5/5 · Alf
A modeler migrates element names from another language into Alf and wants to write them as plain identifiers, without single quotes. Which of these names is legal as a plain identifier?
A. Class
B. from
C. true
D. hastype
Answer: A. Alf 7.7 lists reserved words, which have the form of identifiers but cannot be used as them. The literals true and false are also excluded (7.6). Because case is significant in names (7.6), Class differs from the reserved word class and is a legal identifier.
- A. Correct: case is significant in names (7.6), and the reserved word is the lowercase class (7.7), so Class is a legal identifier.
- B. Wrong: from appears in the reserved word list of 7.7 and cannot serve as an identifier.
- C. Wrong: true has the form of an identifier but is lexically a Boolean literal, not a name (7.6, 7.8.2).
- D. Wrong: hastype is in the reserved word list of 7.7.
Source: OMG Action Language for Foundational UML (Alf) 1.1 (formal/2017-07-04), 7.7 · Alf / 7.7 Reserved Words / names versus reserved words and literals
Other OCUP 2 Advanced areas
The same kind of free sample for every other section of the OCUP 2 Advanced bank:
Practise OCUP 2 Advanced with instant feedback
6 free questions in study mode · no card · full OCUP 2 Advanced bank with area filters and the error log: $9 (regularly $15) one-time · no dumps, no ads.
Start OCUP 2 Advanced free →
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by OMG. OCUP 2 Advanced and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official OMG materials (as of November 2026); always confirm current details with the vendor before booking.