OCUP 2 Foundation study materials
OCUP 2 Foundation study resources

OCUP 2 Foundation: UML Elements and Attributes

OCUP 2 Foundation · Work through your exam, one topic at a time.

All guide sections

UML Elements and Attributes

What the exam tests

This domain covers the vocabulary beneath every diagram: Classifier, Property, Operation, Parameter, Multiplicity, Visibility, Constraint, Stereotype, and relationship kinds. Items often ask what an attribute is in the metamodel or how a feature is marked.

Core rules

  • A Classifier owns features. A Property is a typed, multiplicity-bearing feature. In UML 2.5 an attribute is a Property, and an association end is also a Property (memberEnd/ownedEnd); that is why a reference can be drawn either way.
  • Property modifiers: type, multiplicity, visibility (public +, private -, protected #, package ~), isStatic (underlined), isReadOnly, isDerived (/), default value, {ordered}, {unique}, {subsets}, {redefines}.
  • Operation: name, parameters with direction in, out, inout or return, visibility, isAbstract (italic name), isStatic (underline), isQuery. Parameter multiplicities are legal.
  • Multiplicity is a range: 1, 0..1, , 1.., 2..5. Ordering and uniqueness are separate constraints from multiplicity.
  • Constraints use braces, for example {balance >= 0}, or OCL; stereotypes use guillemets, for example «entity».

Worked example

On class Order, - lines: OrderLine [0..*] {ordered} is a private Property named lines, typed OrderLine, with multiplicity zero-to-many and the ordered constraint. It is an owned attribute, not a separate association. Private visibility means access is restricted to Order; {ordered} means sequence matters, so line 1 precedes line 2.

Traps

  • Writing 1..* but calling it optional: 1..* requires at least one value.
  • Confusing {ordered} with {unique}; a collection can be both ordered and non-unique.
  • Forgetting that abstract operation names are italic and static features underlined; both are mark-bearing.
  • Treating a stereotype as a subclass. It is an extension applied with guillemets.
  • Assuming attribute and association end are different metamodel elements; both are Properties.