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 1Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In UML 2, which metaclass is the abstract superclass of both Class and Interface, and also of DataType and PrimitiveType?
- RedefinableElement
- Feature
- Classifier Correct answer.
- Type
Explanation
Classifier is the general abstraction for anything that can have generalisations and features, and Class, Interface, DataType and PrimitiveType all specialise it. Type is a superclass of Classifier but does not cover Interface's feature-bearing role in the same way, and Feature describes members rather than the owners.
Question 2Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A modeller needs a structural feature typed by another classifier that is owned by a class and navigable from it. Which element should be used?
- Property Correct answer.
- Port
- Reception
- Operation
Explanation
Property is the metaclass for structural features, including attributes and association ends, and it carries a type plus multiplicity. Ports are properties restricted to encapsulated classifiers, Operations are behavioural features, and Receptions describe signal handling.
Question 3Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which UML element is used to model a whole-part relationship where the part may be shared and has no lifetime dependency on the whole?
- Generalization
- Aggregation Correct answer.
- Composition
- Realization
Explanation
Shared aggregation is drawn as a hollow diamond on the whole end and imposes no lifetime dependency on the parts. Composition uses a filled diamond and does imply that the part's lifetime is bounded by the whole.
Question 4Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which element represents a change of state triggered by an Event in a StateMachine?
- Region
- Transition Correct answer.
- Pseudostate
- Vertex
Explanation
A Transition is the directed relationship between Vertices that fires when its trigger event occurs and its guard is satisfied. Vertices are the nodes, Regions partition states, and Pseudostates are transient control nodes.
Question 5Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which Interaction element expresses that one message is sent only if a guard condition holds, without depicting the message as a separate fragment?
- CombinedFragment with operator alt
- Gate on the enclosing fragment
- Lifeline with a selector
- Message with a guard on its send event Correct answer.
Explanation
A Message may carry a guard through its send Event's constraint, making the message conditional without introducing a fragment. CombinedFragment with alt shows alternative operands, a selector distinguishes lifeline instances, and a Gate is a connection point on a fragment boundary.
Question 6Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which UseCase relationship indicates that the behaviour of the source use case always includes the behaviour of the target use case?
- Generalization
- Extend
- Association
- Include Correct answer.
Explanation
Include is a directed relationship in which the including use case always incorporates the included use case's behaviour. Extend is conditional and optional, and Generalization is taxonomic.
Question 7Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In a Component diagram, which element specifies a contract of services that a component provides or requires?
- Interface Correct answer.
- Artifact
- Node
- Collaboration
Explanation
Interfaces are the provided and required contracts attached to components, drawn as ball and socket or as classified dependencies. Artifacts are physical manifestations, Nodes are deployment hosts, and Collaborations describe cooperating roles.
Question 8Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which Activity element merges multiple incoming control flows without synchronising them, passing a token through as soon as any one arrives?
- MergeNode Correct answer.
- InitialNode
- DecisionNode
- JoinNode
Explanation
A MergeNode has multiple incoming and one outgoing flow and forwards each arriving token immediately without waiting. A JoinNode synchronises by requiring tokens on all incoming flows.
Question 9Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A modeller must apply a stereotype to a Package and also attach a constraint expressed in a specific language. Which two elements are used?
- Extension and ValueSpecification
- Stereotype and Constraint with a language body Correct answer.
- Profile and Comment
- Class and OpaqueExpression
Explanation
Stereotypes extend metaclasses such as Package and are applied as stereotype applications, while Constraint carries a ValueSpecification whose body can be written in a named language. Profiles package the definitions, and Comments are unstructured remarks.
Question 10Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement correctly distinguishes a Connector from an Association in UML 2?
- A Connector always owns its ends, while an Association never does
- An Association may carry a trigger, but a Connector may not carry any end
- A Connector is only valid in Class diagrams, whereas an Association is only valid in Component diagrams
- A Connector links instances or parts and may be an assembly or delegation connector, while an Association is a classifier-level relationship between typed ends Correct answer.
Explanation
Connectors are runtime links between parts or instances, including assembly and delegation connectors in composite structures, whereas Associations describe structural relationships between classifiers with typed ends. Both may own ends, so ownership is not the distinction.
Question 11Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A class diagram shows a class Realization to an interface with a dashed line and hollow triangle. Which underlying relationship does this notation denote?
- Substitution
- InterfaceRealization Correct answer.
- Dependency
- Generalization
Explanation
The dashed line with a hollow triangle from a classifier to an interface denotes InterfaceRealization, a contract-implementing relationship. Generalization uses a solid line with a hollow triangle, and a plain Dependency uses a dashed arrow without a triangle.
Question 12Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In a composite structure, a delegation connector is drawn from an internal part to the boundary of the enclosing classifier. What does it express?
- The part and the enclosing classifier share the same instance
- The part is created only when the enclosing classifier is destroyed
- The internal part inherits the enclosing classifier's superclass
- The enclosing classifier forwards calls received at its port to the internal part Correct answer.
Explanation
A delegation connector routes requests arriving at the composite's port to an internal part that handles them, supporting encapsulation. It is not an inheritance or lifetime construct and does not merge instances.
Question 13Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which combination correctly models a Signal being sent by one object and handled asynchronously by another?
- A SendOperation event on a Transition plus a Reception on the receiving classifier Correct answer.
- A CallOperation on a Transition plus an Operation on the receiver
- A ChangeEvent on a Transition plus a Property on the receiver
- A TimeEvent on a Transition plus an Association on the receiver
Explanation
Signals are modelled as Signal classifiers, sent through a SendSignalAction or a signal-triggered Transition, and handled by a Reception that declares the classifier responds to that Signal. CallOperation and Operation describe synchronous calls, not signal handling.
Question 14Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which element owns the definition of a StateMachine's behaviour when it is reused by several classes?
- A FinalState in each class
- A Region nested inside each class
- A StateMachine referenced as a submachine by a SubmachineState Correct answer.
- A Pseudostate of kind entryPoint
Explanation
A StateMachine can be defined once and referenced by SubmachineStates, which reuse its regions and transitions. Regions are owned partitions, entry points are pseudostates, and final states terminate behaviour.
Question 15Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which Activity construct guarantees that exactly one of several alternative flows is taken based on guards?
- FlowFinalNode
- ForkNode with multiple outgoing edges
- DecisionNode with guarded outgoing edges plus a MergeNode Correct answer.
- JoinNode with multiple incoming edges
Explanation
A DecisionNode evaluates guards and selects one outgoing edge, and the branches later reconverge at a MergeNode. Fork and Join handle concurrency, and FlowFinalNode terminates a flow.
Question 16Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A model must capture that one Operation is implemented by a Behaviour such as an Activity. Which element links them?
- Constraint with a language body
- Parameter with an effect kind
- BehavioralFeature with a method reference to a Behavior Correct answer.
- Property with a default value
Explanation
An Operation is a BehavioralFeature that may reference a method, which is a Behavior such as an Activity or OpaqueBehavior implementing it. Parameters describe inputs and outputs, and Constraints restrict values.
Question 17Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which Deployment diagram element represents a physical computational resource such as a server, as opposed to a software execution environment?
- ExecutionEnvironment
- Artifact
- DeploymentSpecification
- Device Correct answer.
Explanation
Device is a Node subtype representing physical hardware, while ExecutionEnvironment is a software node hosted on hardware. Artifacts are deployed information and DeploymentSpecifications are deployment descriptors.
Question 18Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In an Interaction, what does a Lifeline's selector expression such as 'thread[2]' specify?
- Which individual of the represented part or classifier the lifeline denotes Correct answer.
- The duration constraint on a message
- The guard condition for the next message
- The order in which messages are sent
Explanation
The selector is a string expression that distinguishes which instance of the represented classifier or part a lifeline refers to. Ordering is given by sequence numbers or vertical position, guards belong to messages, and duration constraints are separate.
Question 19Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which Profile mechanism allows a stereotype to add tagged values to the elements it extends?
- Generalization between stereotypes only
- Extension with owned Properties on the Stereotype Correct answer.
- PackageImport of the profiled package
- Substitution between profiles
Explanation
A Stereotype extends a metaclass through an Extension, and Properties owned by the stereotype become tagged values applicable to extended elements. Generalization, import and substitution do not add tagged values.
Question 20Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which element models a Class whose instances cannot change their structural feature values after creation?
- A Class with isAbstract set true
- A Class with isActive set true
- A Class with the isReadOnly property of its Properties set true Correct answer.
- A Class with isFinalSpecialization set true
Explanation
Read-only Properties prevent modification of their values after initialisation, which is the UML mechanism for immutability of structural features. Abstractness, final specialisation and active class status concern instantiation, subclassing and concurrency.
Question 21Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which StateMachine pseudostate is used to join multiple incoming transitions into a single outgoing transition without a guard evaluation?
- Choice
- Junction
- EntryPoint
- Join Correct answer.
Explanation
A join pseudostate merges several incoming transitions into one outgoing transition, typically combined with a guard on the outgoing edge. A choice pseudostate evaluates guards dynamically, and a junction chains short transitions.
Question 22Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A model uses a Collaboration to describe a pattern of roles. Which element binds actual classifiers to those roles?
- Manifestation
- InterfaceRealization
- ComponentRealization
- CollaborationUse with role bindings Correct answer.
Explanation
A CollaborationUse binds the roles declared in a Collaboration to specific parts or classifiers through role bindings. ComponentRealization, InterfaceRealization and Manifestation relate components, interfaces and artifacts, not collaboration roles.
Question 23Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Two classes each own an Association end typed by the other, and both ends are navigable. Which modelling choice best expresses this bidirectionally navigable association?
- A Dependency in each direction
- A single Association with two navigable owned ends Correct answer.
- Two separate Associations each with one navigable end
- A Generalization in each direction
Explanation
A single Association with two navigable ends expresses bidirectional navigation and keeps the relationship unified. Two separate associations would model two distinct relationships, and generalisation or dependency do not express navigability of structural links.
Question 24Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement about the relationship between a Class and its nested Classifier is correct in UML 2?
- A nested Classifier must be an Interface
- A nested Classifier is a synonym for an inner part Property
- A nested Classifier is always private and cannot be referenced outside the owner
- A nested Classifier is owned through the nesting relationship and may be referenced by qualified name from outside Correct answer.
Explanation
Nesting is an ownership relationship in which the nested classifier is a member of the owner's namespace and can be referenced using a qualified name. Visibility is controlled by the member's visibility, and nesting is distinct from parts and interfaces.
Question 25Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A Region inside a composite State contains a submachine reference and an entryPoint pseudostate. How is the entryPoint used?
- It defines a deferred event for the composite state
- It marks the initial vertex of the region
- It identifies a point where an external transition may enter the composite state and reach an internal vertex Correct answer.
- It terminates the composite state when reached
Explanation
An entryPoint pseudostate exposes an internal vertex so that transitions from outside can target the composite state and enter at that point. Termination is done by FinalState, deferral is a state property, and the initial vertex is a separate initial pseudostate.
Question 26Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In a UML 2 model, an InstanceSpecification is used to represent a particular runtime object. Which element does it use to record the concrete value assigned to an attribute such as 'status'?
- A Slot whose definingFeature is the attribute and whose value is a ValueSpecification Correct answer.
- A Property whose aggregation is composite and whose multiplicity is 1
- A Constraint attached to the instance with an OpaqueExpression body
- An Association end owned by the classifier of the instance
Explanation
A Slot is the element that owns the value of one structural feature for one instance; its definingFeature must be a StructuralFeature of the instance's classifier, and the value is given as a ValueSpecification such as LiteralString. Properties describe the type-level structure, not the individual value held at runtime.
Question 27Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
An architect wants to show that a component offers a set of operations to the rest of the system while internally depending on a separate persistence component. Which pair of notation choices expresses this most precisely?
- A provided Interface drawn as a lollipop plus a usage Dependency from the component to the persistence Interface Correct answer.
- A required Interface drawn as a socket plus a composite Aggregation to the persistence component
- A provided Interface drawn as a socket plus a Realization to the persistence component
- A provided Interface drawn as a lollipop plus a Generalization from the component to the persistence component
Explanation
Provision is expressed with a provided Interface (lollipop) and dependency on another contract is expressed with a usage Dependency or a required Interface (socket). Generalization and composite aggregation both assert structural subtype or ownership semantics that are not intended here.
Question 28Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A modeller needs to attach a free-form note to a diagram that explains why a particular Association is modelled as derived. Which UML element is intended for this purpose?
- An OpaqueExpression owned by the Association
- A tagged value defined by a stereotype applied to the Association
- A Comment with an anchor to the Association Correct answer.
- A Constraint on the Association with a natural-language body
Explanation
A Comment is the general-purpose element for human-readable remarks, and it can be attached to any element by an anchor (in diagrams, a dashed line to the note symbol). Constraints, OpaqueExpressions and tagged values all carry model semantics rather than informal commentary.
Question 29Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement best captures how a Port on a composite-structure Class differs from an ordinary Property of that Class?
- A Port is a Property that must be typed by a Component and can never be typed by an Interface
- A Port is a Property whose type specifies a contract of interactions at the boundary, and it may carry provided and required Interfaces Correct answer.
- A Port is a special Association end that links the classifier directly to an external actor
- A Port is a ConnectableElement that owns the internal parts it connects and hides them from the classifier
Explanation
In UML 2 a Port is a kind of Property declared on a classifier's boundary; its type plus any provided or required Interfaces define the interaction contract visible to the environment. Ports are not restricted to Component types, do not own internal parts, and are not association ends.
Question 30Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A behaviour must be modelled so that a token entering a fork node continues along every outgoing edge concurrently. Which statement about the fork node is correct?
- It has several incoming and several outgoing edges, and it merges tokens pairwise before copying
- It has one incoming edge and several outgoing edges, and it selects exactly one edge by evaluating guards
- It has one incoming edge and several outgoing edges, and it copies the incoming token to each outgoing edge Correct answer.
- It has several incoming edges and one outgoing edge, and it waits for all of them
Explanation
A fork node in UML Activity modelling has a single incoming flow and multiple outgoing flows, and each outgoing flow receives a copy of the incoming token, enabling concurrent execution. The multiple-in/single-out shape is the join, and guard-based selection describes a decision node.
Question 31Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In a StateMachine, a transition is specified with a trigger, a guard and an effect. Which description of these parts is correct?
- The trigger is a Boolean constraint, the guard is an Event, and the effect is a State entered after firing
- The trigger is an Event, the guard is a Behaviour, and the effect is a Boolean constraint evaluated after firing
- The trigger is an Event whose occurrence can enable the transition, the guard is a Boolean constraint evaluated before firing, and the effect is a Behaviour executed on firing Correct answer.
- The trigger is a Behaviour executed on firing, the guard is a Boolean constraint, and the effect is the Event that enabled the transition
Explanation
A transition's trigger references an Event (such as a CallEvent, SignalEvent or TimeEvent); the guard is a Boolean constraint that must be true for the transition to fire; the effect is an optional Behaviour executed when the transition fires. The other options permute these roles.
Question 32Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A class must expose an operation whose parameter accepts any classifier that realizes a given Interface. Which typing choice expresses this constraint correctly?
- Type the parameter with the Interface itself Correct answer.
- Type the parameter with a Realization to the Interface
- Type the parameter with an Object whose classifier is the Interface
- Type the parameter with a Dependency to the Interface
Explanation
Typing a parameter with an Interface means the argument may be any instance of any classifier that realizes that Interface, which is exactly the required contract. An Object is an instance specification, while Dependency and Realization are relationships and cannot serve as a type.
Question 33Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement correctly describes the semantics of an AssociationClass in UML 2?
- It is a Class that owns a separate Association as a nested member without sharing identity
- It is both an Association and a Class, so it has association ends and can also own attributes and operations Correct answer.
- It is an Association whose ends must both be composite aggregations
- It is a Class whose instances are the links of an ordinary binary Association but which cannot have features
Explanation
An AssociationClass is a single model element with the properties of both an Association and a Class: it connects the participating types through its ends and simultaneously declares features such as attributes and operations. The features describe the link itself, which is why the construct exists.
Question 34Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A model needs to state that a Class may only be instantiated while a separate system-wide flag is true. Which UML construct carries this rule?
- An Invariant on the Class's default Property value
- A Constraint owned by the Class and expressed as an OpaqueExpression or a state invariant Correct answer.
- A Guard on the Class's internal StateMachine
- A Precondition on the Class's constructor Operation with a natural-language body
Explanation
A Constraint attached to a Classifier states conditions that must hold for its instances, and the body may be written in any language via OpaqueExpression. A precondition is attached to an Operation and restricts a call rather than the existence of instances, and guards belong to transitions.
Question 35Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
In a Class diagram, which notation correctly shows that class B is a specialization of class A while also being a part of class C?
- A filled-diamond composite Aggregation from B to A plus a hollow-triangle Generalization from C to B
- A dashed Realization from B to A plus a plain Association from C to B
- A hollow-triangle Generalization from A to B plus a hollow-diamond Aggregation from C to B
- A hollow-triangle Generalization from B to A plus a filled-diamond composite Aggregation from C to B Correct answer.
Explanation
Generalization is drawn from the more specific classifier to the more general one with a hollow triangle at the general end, and composite aggregation is drawn with a filled diamond at the whole end. Combining these gives B as a kind of A and as an owned part of C.
Question 36Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A Signal is defined with attributes and an object must react to it asynchronously without blocking the sender. Which modelling combination is correct?
- A synchronous Operation on the receiving Class, plus a CallOperationAction in the sender's behaviour
- A Reception on the receiving Class referencing the Signal, plus a SendSignalAction in the sender's behaviour Correct answer.
- An Event on the receiving Class, plus a CreateObjectAction in the sender's behaviour
- A Reception on the sender referencing the Signal, plus an AcceptEventAction in the receiver's behaviour
Explanation
Asynchronous signal handling is modelled with a Reception owned by the receiver that names the Signal it handles, and the sender uses a SendSignalAction, which returns control immediately. A synchronous Operation with CallOperationAction would block the sender until the call returns.
Question 37Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement about the relationship between a Class and the Classifiers nested inside it is correct in UML 2?
- A nested Classifier cannot have instances separate from instances of the owning Class
- A nested Classifier is a Property of the owning Class and is instantiated with it
- A nested Classifier is in the namespace of the owning Class and may be referenced by qualified name such as Outer.Inner Correct answer.
- A nested Classifier is implicitly a subtype of its owning Class
Explanation
Nesting places the inner Classifier in the owner's namespace, so it is referenced with a qualified name and does not by itself imply subtyping or instance binding. The inner Classifier remains an independent type whose instances need not be tied to any outer instance.
Question 38Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A collaboration defines roles such as 'subject' and 'observer'. Which element is used to state that concrete classes Subject and Observer play those roles?
- A Generalization from the Collaboration to each concrete class
- A CollaborationUse with RoleBindings from the roles to the concrete classifiers Correct answer.
- A Dependency from each concrete class to the Collaboration
- A composite Aggregation from the Collaboration to each concrete class
Explanation
A CollaborationUse represents one application of a Collaboration pattern, and its RoleBindings connect each ConnectableElement role in the pattern to the classifier or part that plays it. Dependencies, generalizations and aggregations do not carry role-to-classifier binding semantics.
Question 39Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A Deployment diagram must show that an artifact is deployed on a node and that the node also nests another node. Which notation is correct?
- A Generalization from the artifact to the node, plus a composite Aggregation between the two nodes
- A Realization from the node to the artifact, plus a plain Association between the two nodes
- A «deploy» stereotype on the artifact, plus a Dependency between the two nodes
- A «manifest» or deployment Dependency from the artifact to the node, plus graphical nesting of the inner node inside the outer node Correct answer.
Explanation
Deployment of an artifact on a node is shown with a deployment Dependency (often stereotyped «deploy» or «manifest»), and node containment is shown by nesting the inner Node symbol inside the outer one or by composition. Generalization and Realization express subtype and implementation semantics instead.
Question 40Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
An Interaction uses a CombinedFragment with operator 'alt' containing two operands. Which statement about its semantics is correct?
- The first operand always executes and the others execute only if the first fails
- Exactly one operand whose guard is true is chosen, and if several guards are true the choice is nondeterministic Correct answer.
- No operand executes unless every guard evaluates to true
- All operands whose guards are true execute concurrently
Explanation
The 'alt' operator models alternative behaviour: at most one operand is selected, and among operands whose guards hold the selection is not determined by the model. Concurrency is expressed with 'par', and there is no built-in retry or all-or-nothing rule.
Question 41Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which element is used to express that an Operation's behaviour is specified by a reusable Activity rather than by an opaque body?
- An OpaqueBehavior owned by the Operation's Class
- A Behavior on the Operation, specifically a method that references the Activity Correct answer.
- An ActivityPartition on the Operation
- A StateMachine owned by the Operation's Parameter
Explanation
An Operation may have a method, which is a Behavior such as an Activity, referenced through the Operation's owned behavior; this links the specification of the operation to its implementation. OpaqueBehavior would carry a textual body instead of a reusable Activity graph.
Question 42Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A Class has two associations to the same target class, one for 'supervisor' and one for 'mentor'. What is the most precise way to distinguish them in the model?
- Give each Association a distinct name and distinct role names on the target ends Correct answer.
- Give each Association the same name but different multiplicities
- Use a single Association with a derived union at the target end
- Merge them into one Association with multiplicity 2 at the target end
Explanation
When several associations connect the same pair of classes, they are distinguished by association name and, more importantly, by distinct role names (the end property names) at the target ends. Multiplicity alone does not identify which link means what.
Question 43Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A model must express that one UseCase includes the behaviour of another only when a certain condition holds. Which construct is appropriate?
- A Dependency from the including use case to the included one
- An Extend relationship with a condition and an extension point
- An Include relationship with a condition expressed as a Constraint on the InclusionPoint Correct answer.
- A Generalization between the two use cases
Explanation
Conditional inclusion is not expressed by Include, which is unconditional; conditional behaviour is modelled with Extend, whose ExtensionLocation (extension point) and condition determine whether the extending use case runs. Generalization and plain Dependency carry different semantics.
Question 44Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement about a Lifeline's name and its selector is correct?
- Both the name and the selector must reference distinct Classifiers
- The selector identifies the classifier and the name distinguishes the instances
- The name is optional and the selector must be an integer literal
- The name identifies the represented ConnectableElement and the selector distinguishes between multiple instances of it Correct answer.
Explanation
A Lifeline denotes one participant in an Interaction; its name refers to a ConnectableElement such as a part or classifier, and the selector is an expression that picks one among several instances of that element. The selector need not be an integer literal, and the two fields have distinct roles.
Question 45Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A modeller applies a stereotype to a Class and wants the stereotype to contribute an additional attribute 'cacheSize'. Which mechanism provides this?
- An Association from the Stereotype to the Class
- A Constraint owned by the Profile containing the Stereotype
- A Property defined on the Stereotype, which becomes a tagged value on the extended element Correct answer.
- An OpaqueExpression owned by the Stereotype
Explanation
A Stereotype is a Class, so Properties declared on it appear as tagged values on every element it extends. Associations, OpaqueExpressions and Constraints do not add named, typed attributes to the extended element.
Question 46Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A structured classifier needs a part whose multiplicity is 0..* and whose instances are created only when needed. Which notation expresses this on the internal part?
- An Association end with multiplicity 0..* owned by the enclosing classifier
- A Property with multiplicity 1..1 and isComposite set to true
- A Property with multiplicity 0..* typed by the part's Classifier, drawn inside the composite structure Correct answer.
- A Port with multiplicity 0..* typed by the part's Classifier
Explanation
Internal parts in a composite structure are Properties with a type and a multiplicity; 0..* states that zero or more instances may exist and that they need not all be present. Setting multiplicity to 1..1 contradicts the requirement, and a Port is a boundary feature rather than an internal part.
Question 47Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which statement correctly distinguishes a StateMachine's entry and exit Behaviours from activities performed while the state is active?
- Entry runs on leaving the state and exit runs on entering, while doActivity runs only once
- doActivity runs once on entering and entry runs continuously while the state is active
- Entry, exit and doActivity all run once on entering the state
- Entry and exit Behaviours run once on entering and leaving the state, while a doActivity runs for as long as the state is active and may be interrupted Correct answer.
Explanation
A State may declare entry behaviour executed when the state is entered, exit behaviour executed when it is left, and a doActivity that executes while the state is active and can be interrupted by a completion event or outgoing transition. The three are distinct and are not interchangeable.
Question 48Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
Which element in a Class diagram declares that a Class cannot be instantiated and is intended to be completed by subclasses?
- A Generalization from the Class to itself
- The isAbstract flag set to true on the Class Correct answer.
- A stereotype «abstract» applied to the Class
- A Constraint with body 'abstract' owned by the Class
Explanation
Abstractness is a built-in Boolean attribute of Classifier, shown by italicising the name in diagrams; setting isAbstract to true means no direct instances exist. Constraints, stereotypes and self-generalizations do not carry this built-in meaning.
Question 49Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
A model must show that a Package imports the public contents of another Package so that unqualified names resolve. Which relationship is appropriate?
- A PackageMerge from the importing Package to the imported one
- A Generalization from the importing Package to the imported one
- A PackageImport with visibility public from the importing Package to the imported one Correct answer.
- A Dependency stereotyped «access» from the imported Package to the importing one
Explanation
PackageImport with public visibility adds the imported package's public members to the importing package's namespace without copying them, which is exactly name resolution. PackageMerge combines contents into the target package, and «access» import is private and would not support the intended unqualified public use.
Question 50Complete UML palette of elements and attributes for modeling structure and behavior in up to the largest system models
An Interaction models a message sent from one lifeline to another. Which statement about synchronous and asynchronous MessageSort is correct?
- A synchronous message is drawn with an open arrowhead and an asynchronous one with a filled arrowhead
- A synchronous call message expects a reply message before the caller resumes, while an asynchronous signal message does not Correct answer.
- An asynchronous message requires a reply, while a synchronous message never has one
- Both message sorts require a reply, but only the asynchronous one blocks the caller
Explanation
The MessageSort distinguishes synchCall, which represents an operation call whose caller waits for a reply, from asynchSignal and asynchCall, which do not block the sender and need no reply. Arrowhead conventions relate to the message kind, but the decisive difference is the blocking reply semantics.