OCUP 2 Intermediate study materials
OCUP 2 Intermediate study resources

OCUP 2 Intermediate practice questions

One question at a time. Build your OCUP 2 Intermediate understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1UML elements and attributes of structures used in complex and larger system models

In a UML class diagram, which property of a Classifier records the number of instances that may exist at runtime and is written near the association end?

  1. Navigability
  2. Multiplicity Correct answer.
  3. Visibility
  4. Aggregation kind

Explanation

Multiplicity constrains how many links or instances may participate at an association end, and it is shown as a range such as 0..1 or 1..*. Visibility controls access to features, navigability controls traversal direction, and aggregation kind expresses whole-part semantics, so only multiplicity addresses instance counts.

Question 2UML elements and attributes of structures used in complex and larger system models

A composite structure diagram shows a part with the notation '1..*' inside a class box. What does this notation specify for the containing classifier?

  1. The part role is optional and may be absent at runtime
  2. The containing classifier owns at least one instance of the part type Correct answer.
  3. The part type must be a subclass of the containing classifier
  4. The part role is bound to exactly one instance at all times

Explanation

Multiplicity on a part in a structured classifier gives the permitted number of instances playing that role within one instance of the whole. The lower bound 1 means at least one instance exists, and the upper bound * allows more, so the containing object owns one or more parts in that role.

Question 3UML elements and attributes of structures used in complex and larger system models

Which UML element is a named, typed value declared by a classifier and typically drawn as an attribute compartment entry?

  1. Operation
  2. Reception
  3. Property Correct answer.
  4. Parameter

Explanation

A Property is the metaclass behind attributes, association ends, and parts; when owned by a classifier and shown in the attribute compartment it represents a typed structural feature. Operations describe behavior, receptions describe signal handling, and parameters belong to behavioral features.

Question 4UML elements and attributes of structures used in complex and larger system models

In UML, what does an association end's navigability indicate?

  1. That the association end is owned by the classifier at that end
  2. That instances at the opposite end can be reached efficiently at runtime
  3. That traversal from the other end toward this end is supported Correct answer.
  4. That the association is derived from another association

Explanation

Navigability is a property of an association end describing whether it is possible to traverse the association from the opposite end to this end. A small arrow near an end marks that end as navigable; it does not promise performance and does not by itself encode derivation or ownership.

Question 5UML elements and attributes of structures used in complex and larger system models

Which UML relationship is drawn as a hollow diamond at the whole end and represents a whole-part relationship where the part can outlive the whole?

  1. Realization
  2. Shared aggregation Correct answer.
  3. Composition
  4. Generalization

Explanation

Shared aggregation uses a hollow diamond and denotes a whole-part relationship without exclusive ownership or lifetime dependency. Composition uses a filled diamond and implies the part's lifetime is tied to the whole, while generalization and realization are classification and contract relationships.

Question 6UML elements and attributes of structures used in complex and larger system models

A class box displays the entry '- count : Integer [0..1]'. Which feature of the class does the '- ' prefix denote?

  1. Package visibility
  2. Protected visibility
  3. Derived value
  4. Private visibility Correct answer.

Explanation

In UML visibility markers, minus denotes private, hash denotes protected, tilde denotes package, and plus denotes public. A derived feature would instead be marked with a slash before the name, so the leading minus here means the attribute is private.

Question 7UML elements and attributes of structures used in complex and larger system models

Which UML element groups model elements that share a common structure and behavior, and can be marked as abstract?

  1. Artifact
  2. Component
  3. Classifier Correct answer.
  4. Package

Explanation

A Classifier is the general abstraction for types that have instances, including classes, interfaces, and data types, and its name may be shown in italics when abstract. Packages are namespaces, components are deployable modular units, and artifacts are physical manifestations.

Question 8UML elements and attributes of structures used in complex and larger system models

In a class diagram, what does a generalization arrow with a hollow triangle pointing to a class named Vehicle indicate about a class named Car?

  1. Car depends on Vehicle at runtime
  2. Car realizes the interface Vehicle
  3. Car aggregates instances of Vehicle
  4. Car is a specialization of Vehicle Correct answer.

Explanation

Generalization is drawn as a solid line with a hollow triangle at the more general classifier, meaning the subclass inherits from and specializes the superclass. Aggregation, realization, and dependency use different notations and carry different meanings.

Question 9UML elements and attributes of structures used in complex and larger system models

A structured classifier contains two parts connected by a connector. What does the connector specify in a composite structure diagram?

  1. A communication path between those parts within an instance of the containing classifier Correct answer.
  2. A generalization between the part types
  3. A link that must be created by a factory operation
  4. A deployment of the parts onto separate nodes

Explanation

Connectors in a structured classifier describe links between parts that exist inside one instance of the containing classifier, enabling them to interact. They are not generalization, deployment, or a mandated creation mechanism.

Question 10UML elements and attributes of structures used in complex and larger system models

In a composite structure diagram, a port is drawn on the boundary of a classifier. What does a port represent?

  1. A dependency from the classifier to a package
  2. A stored attribute value exposed to subclasses
  3. A distinct interaction point through which the classifier interacts with its environment Correct answer.
  4. A namespace that owns the classifier's nested elements

Explanation

A Port is a property of a classifier representing a distinct interaction point whose provided and required interfaces define how the classifier interacts with its environment or internal parts. It is not a data attribute, a namespace, or a dependency.

Question 11UML elements and attributes of structures used in complex and larger system models

A class has an attribute declared as 'readOnly'. What does this constraint mean in UML?

  1. The attribute value cannot be changed after the object is initialized Correct answer.
  2. The attribute is computed from other attributes
  3. The attribute may hold a null value
  4. The attribute is hidden from other classifiers

Explanation

The readOnly constraint on a property means the value may not be modified after initialization. Hiding relates to visibility, computing relates to derivation, and nullability relates to multiplicity with a lower bound of zero.

Question 12UML elements and attributes of structures used in complex and larger system models

Which notation in a class compartment indicates that an operation is abstract?

  1. The operation name is prefixed with a slash
  2. The operation name is shown in italics Correct answer.
  3. The operation name is underlined
  4. The operation name is followed by a dashed line

Explanation

Abstract operations, like abstract classifiers, are shown with the name in italics. Underlining marks static features, a slash marks derived features, and a dashed line is not an operation notation.

Question 13UML elements and attributes of structures used in complex and larger system models

In a UML model, a property has multiplicity 0..* and is marked with isComposite = true. Which statement best describes the semantics?

  1. The property holds at most one value that is shared with other owners
  2. The property may hold any number of values, each exclusively owned and destroyed with the whole Correct answer.
  3. The property must hold exactly one value owned by the classifier
  4. The property holds values that are never destroyed

Explanation

Composite aggregation means the part instances are owned by the whole and their lifetimes are tied to it, and multiplicity 0..* allows zero or more such parts. Shared ownership, exact-one cardinality, and permanent lifetime all contradict this combination.

Question 14UML elements and attributes of structures used in complex and larger system models

A class named Order has an association to Customer with multiplicity 1 at the Customer end and 0..* at the Order end. What does the multiplicity at the Order end constrain?

  1. The number of attributes owned by Order
  2. The number of Customers linked to one Order
  3. The number of Orders linked to one Customer Correct answer.
  4. The number of operations Customer may declare

Explanation

Multiplicity written at an association end constrains how many instances at that end may be linked to a single instance at the opposite end. The 0..* at the Order end therefore bounds the Orders associated with one Customer.

Question 15UML elements and attributes of structures used in complex and larger system models

Which UML relationship is appropriate when a class declares that it implements the operations defined by an interface?

  1. Realization Correct answer.
  2. Generalization
  3. Dependency
  4. Association

Explanation

Realization is the relationship between a classifier and an interface whose contract the classifier implements, drawn as a dashed line with a hollow triangle. Generalization links classes or interfaces in a specialization hierarchy, dependency is a weaker usage relationship, and association is a structural link.

Question 16UML elements and attributes of structures used in complex and larger system models

A class box shows a compartment entry 'status : Status {ordered}'. What does the ordered constraint convey about the property?

  1. The values are sorted automatically by the classifier
  2. The values must be unique across all instances
  3. The values are read-only after initialization
  4. The values form an ordered collection where position matters Correct answer.

Explanation

The ordered constraint applies to a multi-valued property and states that the collection of values has a defined order in which position is significant. It does not imply automatic sorting, uniqueness, or immutability.

Question 17UML elements and attributes of structures used in complex and larger system models

In UML, what distinguishes an association class from a plain association?

  1. It makes both ends of the association navigable
  2. It replaces the association with a dependency
  3. It forces the association to be composite
  4. It adds attributes and operations to the link itself Correct answer.

Explanation

An AssociationClass is both an association and a class, so the link between instances can carry its own attributes and operations, such as the enrollment record between Student and Course. It does not alter navigability or aggregation and does not become a dependency.

Question 18UML elements and attributes of structures used in complex and larger system models

A structured classifier shows a part typed by an interface rather than a class. What does this modeling choice express?

  1. The part cannot have multiplicity greater than one
  2. The part is a generalization of the containing classifier
  3. The part's actual instance is supplied by some classifier that provides the interface Correct answer.
  4. The part must be instantiated as that interface directly

Explanation

Typing a part by an interface specifies the contract the part must satisfy while leaving the concrete implementation open, so any classifier providing that interface may fill the role. Interfaces are not directly instantiated, and typing by interface does not restrict multiplicity or imply generalization.

Question 19UML elements and attributes of structures used in complex and larger system models

A property is shown with a slash before its name, as in '/ age : Integer'. What does the slash indicate?

  1. The property is a classifier-scoped static feature
  2. The property has been deprecated
  3. The property is derived and its value is computed from other model elements Correct answer.
  4. The property is private to the classifier

Explanation

A leading slash marks a derived property, meaning its value is determined by a computation or rule rather than stored independently. Private visibility uses a minus, static scope uses underlining, and deprecation is not shown with a slash.

Question 20UML elements and attributes of structures used in complex and larger system models

Two classes are connected by an association with no arrowheads and no diamonds. What is the most accurate interpretation?

  1. The association is a composition
  2. The association is a generalization
  3. The association is a plain structural relationship with unspecified navigability Correct answer.
  4. The association is navigable only from the left class

Explanation

An association drawn without navigability arrows or aggregation diamonds denotes a structural relationship between instances whose navigability is not specified in the diagram. It is neither composition nor generalization, and no direction is asserted.

Question 21UML elements and attributes of structures used in complex and larger system models

In a class diagram, an attribute is underlined, as in 'instanceCount : Integer'. What does this notation specify?

  1. The attribute is abstract
  2. The attribute is classifier-scoped rather than instance-scoped Correct answer.
  3. The attribute is derived
  4. The attribute is read-only

Explanation

Underlining a feature indicates classifier scope, meaning one value is shared by all instances rather than held per instance. Abstract features use italics, derived features use a slash, and read-only is a separate constraint.

Question 22UML elements and attributes of structures used in complex and larger system models

A composite structure diagram shows a collaboration with a role bound to a specific part by a dashed line labeled with the role name. What is the purpose of this binding?

  1. It marks the part as composite aggregation
  2. It specifies the deployment node of the part
  3. It maps an abstract role in the collaboration to a concrete part in the containing context Correct answer.
  4. It declares a generalization between the role and the part

Explanation

Role bindings in a collaboration connect roles defined abstractly to the actual parts that fill them in a particular context, allowing one collaboration pattern to be reused. They do not express generalization, aggregation, or deployment.

Question 23UML elements and attributes of structures used in complex and larger system models

A classifier has a property with multiplicity 1..3 marked isComposite = true. Which interpretation is consistent with UML semantics?

  1. Each part owns exactly one whole and may be referenced by up to three wholes
  2. Each instance of the whole owns between one and three parts, and those parts cannot be shared with another whole Correct answer.
  3. The property may hold any number of parts, each destroyed independently of the whole
  4. Each instance of the whole references between one and three shared parts that may also belong to other wholes

Explanation

Composite aggregation makes the whole the exclusive owner of its parts and ties their lifetime to it, while the multiplicity 1..3 fixes the number of parts per whole. Shared ownership and independent lifetimes contradict isComposite, and the multiplicity applies to the parts owned by one whole.

Question 24UML elements and attributes of structures used in complex and larger system models

In a UML metamodel, both an association end and a class attribute are instances of Property. What does this imply for modeling a reference from one class to another?

  1. The reference can be modeled as an association whose navigable end is owned by the referring class Correct answer.
  2. The reference must be modeled twice, once as an attribute and once as an association end
  3. The reference cannot be navigable in both directions
  4. The reference must use a dependency instead of an association

Explanation

Because an association end is a Property, a navigable association end owned by the referring class is semantically equivalent to an attribute typed by the target class. Modeling it once as an owned association end avoids duplication, bidirectional navigability is permitted, and dependency is a weaker relationship.

Question 25UML elements and attributes of structures used in complex and larger system models

A structured classifier defines a part whose multiplicity is 0..1 and whose type is an abstract class. Which statement is correct?

  1. The part's multiplicity forces the abstract class to become concrete
  2. The part may be absent, and when present its instance is of some concrete subclass of the abstract type Correct answer.
  3. The part must contain exactly one instance of the abstract class itself
  4. The part must be absent because abstract classes cannot be instantiated

Explanation

Multiplicity 0..1 makes the part optional, and typing by an abstract class means any concrete subclass instance can fill the role at runtime. Abstract classes are not instantiated directly, but that does not forbid the role; it only constrains which instances qualify.

Question 26UML elements and attributes of structures used in complex and larger system models

A class box lists the operation '+ applyDiscount(rate : Percent = 5) : Money'. What does the '= 5' portion specify for this operation?

  1. The default value used when the argument is omitted at call time Correct answer.
  2. The maximum value the parameter may take at run time
  3. The multiplicity of the parameter within the operation
  4. The initial value of a class attribute named rate

Explanation

In UML an operation parameter may carry a defaultValue, written after '=' in the parameter list. It is applied when a caller supplies no argument for that parameter. It is not a range constraint, a multiplicity, nor an attribute initializer.

Question 27UML elements and attributes of structures used in complex and larger system models

Which visibility marker makes a class feature accessible only to the class itself and to its nested classifiers, and is drawn as a circle with a downward hook in some tools?

  1. Protected
  2. Package
  3. Private Correct answer.
  4. Public

Explanation

Private visibility is written '-' and restricts access to the owning classifier, including its nested elements. Protected ('#') extends access to descendants, package ('~') to the same package, and public ('+') to everyone.

Question 28UML elements and attributes of structures used in complex and larger system models

A class named Sensor declares a static operation 'calibrate()'. How is this operation rendered in the class compartment?

  1. With the keyword {query} appended
  2. With a trailing tilde after the return type
  3. With a leading dollar sign or an underline, depending on the notation Correct answer.
  4. With a leading slash before the operation name

Explanation

Static (classifier-scoped) features are distinguished from instance-scoped ones by underlining the feature, and many tools additionally prefix a '$'. The UML specification permits either rendering convention. A slash marks a derived element, and {query} marks an operation without side effects.

Question 29UML elements and attributes of structures used in complex and larger system models

In a class diagram a class named Engine is drawn with a filled diamond at the Engine end of an association to Car. What does the filled diamond convey?

  1. Engine exists independently of Car and may be shared across many cars
  2. Car is an instance of Engine created by a factory operation
  3. Engine is a composite part of Car and its lifetime is bound to the whole Correct answer.
  4. Engine is a shared part of Car and may be referenced by other cars

Explanation

A filled diamond marks composite aggregation, in which the part is owned by the whole and is destroyed with it. The diamond sits at the end of the whole, so Engine is the part and Car the composite. Shared aggregation would use a hollow diamond.

Question 30UML elements and attributes of structures used in complex and larger system models

Which modeling element is a named description of a set of operations that a classifier promises to provide, without specifying implementation?

  1. Enumeration
  2. Data type
  3. Signal
  4. Interface Correct answer.

Explanation

An interface declares a contract of public operations (and possibly receptions) that realizing classifiers must supply. It carries no implementation of its own. A data type describes values, an enumeration lists literals, and a signal describes an asynchronous event.

Question 31UML elements and attributes of structures used in complex and larger system models

A property in a class box reads 'history : Log [*] {nonunique}'. What does the nonunique constraint state about the property's values?

  1. The values are ordered by insertion time
  2. The values are restricted to a single instance
  3. The values may contain duplicates Correct answer.
  4. The values must be distinct instances

Explanation

By default a multi-valued property is unique, meaning no two values are the same instance. The {nonunique} constraint removes that restriction so the same value may appear more than once, as in a bag or sequence.

Question 32UML elements and attributes of structures used in complex and larger system models

A class named Report has a compartment entry 'author : Person [1] {redefines writer}'. What does the redefines constraint indicate?

  1. The property is a derived value computed from the writer property
  2. The property hides writer by making it private in the superclass
  3. The property is an alias that forwards all reads to writer at run time
  4. The property replaces an inherited property named writer in a specializing context Correct answer.

Explanation

{redefines} is a constraint used on a redefining property that substitutes for an inherited property of the same role in a specializing classifier. It narrows or changes the inherited feature while keeping the role name meaningful in the subtype context. It is not aliasing, derivation, or visibility change.

Question 33UML elements and attributes of structures used in complex and larger system models

A package named Billing imports another package with the notation '«import» Payments'. What does a package import make visible inside Billing?

  1. Only the public classes of Payments that Billing explicitly lists
  2. The public members of Payments, which become available by unqualified name Correct answer.
  3. All members of Payments including private ones
  4. A copy of Payments' contents merged into Billing

Explanation

A package import grants the importing package access to the public members of the imported package, so they can be referenced without qualification. Private members are not imported, and no merge occurs.

Question 34UML elements and attributes of structures used in complex and larger system models

A class has a property typed by an association class named Enrollment. Which statement describes the relationship between the property's values and the association?

  1. Each value is a class that the association generalizes
  2. Each value is one link of the association, carrying the association class's attributes Correct answer.
  3. Each value is the association itself rather than one of its links
  4. Each value is an operation that the association invokes

Explanation

An association class adds attributes and operations to each link of an association. A property typed by that association class therefore holds individual links, each carrying the extra features. It does not hold the association as a whole.

Question 35UML elements and attributes of structures used in complex and larger system models

A class box contains the compartment entry '«subsets» activeOrders : Order [*]'. What does the subsets constraint require of this property's values?

  1. The values must be a subset of the operations declared by Order
  2. The values must be a subset of the association ends owned by Order
  3. The values must be a subset of all Order instances that exist in the running system
  4. The values must be a subset of the values of an inherited property named by the constraint Correct answer.

Explanation

{subsets} states that the property's values are always a subset of the values of another, typically inherited, property it names. It constrains one property relative to another rather than to the whole extent of a class.

Question 36UML elements and attributes of structures used in complex and larger system models

A class named Node declares a unidirectional association to itself, drawn as a line returning to Node with an arrowhead and multiplicity 0..* at the target end. What does this model express?

  1. Each Node may reference any number of other Node instances as children Correct answer.
  2. Each Node is composed of exactly one other Node
  3. Node is a subclass of itself through a reflexive generalization
  4. Node inherits from a metaclass in the UML metamodel

Explanation

A self-association whose target end has multiplicity 0..* means each instance can be linked to many instances of the same class. Navigability from the source end indicates the references are held in that direction. This expresses a recursive structure such as a tree of children.

Question 37UML elements and attributes of structures used in complex and larger system models

In a class diagram, a dependency arrow labeled '«use»' runs from Service to Logger. What does this dependency assert?

  1. Service implements the operations declared by Logger
  2. Logger is a generalization of Service
  3. Service requires Logger for its specification or implementation but holds no lasting link Correct answer.
  4. Service is a part of Logger and is destroyed with it

Explanation

A «use» dependency records that the supplier is needed by the client, for example as a parameter or local variable, without the client keeping a persistent reference. It is weaker than an association and carries no ownership or implementation meaning.

Question 38UML elements and attributes of structures used in complex and larger system models

A classifier named Router contains a part 'ports : Port [4]'. What does the multiplicity [4] on the part specify?

  1. Four Routers share one Port
  2. Each Router instance contains exactly four instances of Port as parts Correct answer.
  3. The Router class may be instantiated at most four times
  4. The Port class has four operations

Explanation

The multiplicity on a part specifies how many instances of the part's type exist within each instance of the containing classifier. Here every Router has exactly four Port parts. It says nothing about how many Routers may exist.

Question 39UML elements and attributes of structures used in complex and larger system models

A class named Shape is marked with the keyword {abstract} and declares an operation 'area() : Real' in italics. What is the consequence for a client that writes 'new Shape()'?

  1. The call is legal because Shape has a default constructor
  2. The call is legal only if area() is overridden in a subclass
  3. The call creates an anonymous subclass of Shape automatically
  4. The call is illegal because abstract classes cannot be instantiated directly Correct answer.

Explanation

An abstract classifier cannot be directly instantiated; only concrete subclasses may be created. The italic operation name reinforces that area() has no implementation in Shape. Clients must instantiate a concrete subtype instead.

Question 40UML elements and attributes of structures used in complex and larger system models

A class named Cache has a property 'entries : Entry [0..*] {ordered, unique}'. Which collection semantics does this combination specify?

  1. An ordered set in which each element appears at most once and insertion order is significant Correct answer.
  2. A set in which each element appears at most once and order is irrelevant
  3. A bag in which duplicates are allowed and order is irrelevant
  4. A sequence in which duplicates are allowed and order matters

Explanation

{ordered} makes the values sequenced, and {unique} (the default) forbids repeated instances. Together they describe an ordered set, where each element occurs once and position matters. Removing either constraint yields a sequence or a set.

Question 41UML elements and attributes of structures used in complex and larger system models

In a class diagram, class Employee has an association to Department with multiplicity 1 at the Department end and 0..* at the Employee end. Which reading is correct?

  1. Each Employee is associated with exactly one Department, and each Department with any number of Employees Correct answer.
  2. Each Department must have exactly one Employee, and each Employee may belong to many Departments
  3. Both ends are optional, so Employees and Departments may exist unlinked
  4. Each Employee may belong to zero or one Department, and each Department must have one Employee

Explanation

Multiplicity at an end states how many instances of the opposite class each instance at that end is linked to. The 1 at the Department end means each Employee is linked to exactly one Department; the 0..* at the Employee end means a Department may have many Employees.

Question 42UML elements and attributes of structures used in complex and larger system models

A class named Account declares a property with the constraint {frozen} in braces after its multiplicity. What does a property-level constraint such as this specify?

  1. A restriction on the values or links of the property that must hold in every valid system state Correct answer.
  2. A note that the property is read-only at the database level
  3. A directive that the property is excluded from serialization
  4. A guarantee that the property is initialized before any operation runs

Explanation

A constraint in braces attached to a property is a boolean condition that must be true for every valid instantiation of the model. It restricts values or links rather than describing storage or serialization behavior. UML itself does not prescribe how such constraints are enforced.

Question 43UML elements and attributes of structures used in complex and larger system models

A generalization set between subclasses of Vehicle is labeled with the constraint {disjoint, complete}. What does this combination state?

  1. A Vehicle instance may belong to several subclasses, and all possible subclasses are listed
  2. A Vehicle instance belongs to at most one subclass, and every Vehicle belongs to one of the listed subclasses Correct answer.
  3. A Vehicle instance belongs to exactly one subclass, and further subclasses are permitted
  4. A Vehicle instance may belong to several subclasses, and more subclasses may be added later

Explanation

{disjoint} forbids a single instance from being a member of more than one subclass in the set, and {complete} states that the listed subclasses cover every instance of the superclass. Together they define a partition of Vehicle.

Question 44UML elements and attributes of structures used in complex and larger system models

A «stereotype» named «entity» is applied to a class and defines a tagged value 'tableName'. What does applying the stereotype to the class accomplish?

  1. It creates a subclass of the class that carries the tagged value
  2. It extends the class with the stereotype's additional properties, such as tableName Correct answer.
  3. It replaces the class's attributes with the tagged values
  4. It converts the class into an interface with the same operations

Explanation

A stereotype extends a metaclass, adding properties (tagged values) and constraints to elements it is applied to. Applying «entity» lets the class carry tableName without changing its basic classifier kind. It does not create subclasses or alter the class into another element type.

Question 45UML elements and attributes of structures used in complex and larger system models

A class named Matrix owns a property 'rows : Row [3]' whose values are marked {ordered} and whose type Row itself owns 'cells : Cell [3]'. What does this nested structure most directly express?

  1. A single Row shared by three Matrix instances
  2. A generalization from Matrix to Row with three specializations
  3. A dependency from Matrix to Cell with multiplicity 3
  4. A three-element ordered collection of Row parts, each of which contains three Cell parts Correct answer.

Explanation

Multiplicities on owned parts nest: each Matrix has three ordered Row parts, and each Row has three Cell parts. This describes a fixed 3x3 composite structure. Generalization and dependency would be drawn with different notation.

Question 46UML elements and attributes of structures used in complex and larger system models

A class named Buffer has a property 'items : Item [0..*] {readOnly}' and an operation 'flush()' that is marked as a query. Which statement is consistent with both constraints?

  1. items may be reassigned to a new collection by flush(), but its contents may change
  2. items is derived from flush() and is recomputed each time it is read
  3. flush() may add Items to items because query operations may modify collections
  4. items cannot be reassigned to another collection, and flush() must not change the system state Correct answer.

Explanation

{readOnly} forbids reassigning the property to a different value after initialization, though the referenced collection may still be mutated. A query operation, by contrast, must leave the system state unchanged, so it cannot modify the collection either.

Question 47UML elements and attributes of structures used in complex and larger system models

Two classifiers, A and B, are related by a dashed arrow with a hollow triangle from A to B, and B is marked «interface». What does this relationship assert about A?

  1. A generalizes B and inherits B's implementation
  2. A is composed of parts typed by B
  3. A depends on B but provides no operations
  4. A realizes B, committing to provide the operations B declares Correct answer.

Explanation

A dashed line with a hollow triangle is the realization notation, and it points at the contract being realized. When the supplier is an interface, the client commits to implementing its operations. Generalization would use a solid line and would not involve an interface contract.

Question 48UML elements and attributes of structures used in complex and larger system models

A property is declared as 'owner : Person [1] {union}' and another property 'manager : Person [1]' is declared as a subset of it. What does the union constraint on owner imply for the two properties?

  1. owner is derived by intersecting manager with all Person instances
  2. owner and manager must be mutually exclusive
  3. owner must equal manager in every system state
  4. owner's values are the union of the values of its subsets, so manager contributes to owner Correct answer.

Explanation

A union property is defined as the union of the values of the properties that subset it. Since manager subsets owner, every manager value is also an owner value, and other subsets may contribute further values. Union does not require equality or exclusivity.

Question 49UML elements and attributes of structures used in complex and larger system models

A structured classifier exposes a port typed by an interface and marks the port with isConjugated = true. What does conjugation change about the port?

  1. The port is hidden from all connectors outside the classifier
  2. The port becomes a behavioral feature rather than a property
  3. The port's provided and required interfaces are swapped, so it now requires what the interface provides Correct answer.
  4. The port's multiplicity is inverted so it accepts zero or one connection

Explanation

Conjugating a port reverses the direction of its interface: interfaces normally provided become required and vice versa. This is used when a classifier consumes a service that its part offers. Conjugation does not affect visibility, multiplicity, or the kind of feature.

Question 50UML elements and attributes of structures used in complex and larger system models

A collaboration named Checkout uses two roles bound by connectors to parts of a structured classifier. What does the collaboration specify in this model?

  1. A generalization hierarchy among the bound parts
  2. A package that imports the bound parts' types
  3. A reusable pattern of cooperating roles that the bound parts conform to Correct answer.
  4. A concrete implementation of the parts that replaces their original types

Explanation

A collaboration describes a pattern of roles and connectors that participating instances conform to. Binding roles to actual parts shows that those parts play the roles in the pattern. The collaboration does not replace the parts' types or impose generalization.