OMG-OCUP2-INT200 practice question 4 of 10

What interface restrictions does a port have?

Full set: 136 questions
Answer options
A: exactly one required interface and exactly one provided interface
B: multiple provided interfaces and multiple required interfaces Correct answer
C: exactly one provided interface or exactly one required interface
D: equal numbers of provided interfaces and required interfaces
E: multiple required interfaces or multiple provided interfaces
Correct Answer:
B. multiple provided interfaces and multiple required interfaces
Explanation

In UML composite structures, a port represents an interaction point between an encapsulated classifier and its environment or between the classifier and its internal parts. A port specifies a set of provided interfaces (services the classifier offers to its environment) and a set of required interfaces (services the classifier needs from its environment). UML places no fixed numeric restriction forcing a port to have only one interface or equal numbers of interfaces. A single port can declare multiple provided interfaces and multiple required interfaces simultaneously to handle complex interactions. Thus, Option B correctly describes the interface capabilities and restrictions of a UML port as defined in the official specification.

Why Incorrect

A. UML ports are not limited to exactly one provided and one required interface; they can declare zero, one, or multiple interfaces of each type.
C. A port can simultaneously feature both provided and required interfaces, so it is not restricted to strictly one or the other.
D. There is no constraint in UML requiring a port to have an equal count of provided and required interfaces.
E. A port is not restricted to having only provided or only required interfaces; it can have both types at the same time.

References

- Object Management Group. (2015). OMG Unified Modeling Language (OMG UML)

Version 2.5

Section 11.3.3 (Ports)

pp. 197–201. https://www.omg.org/spec/UML/2.5/

Scroll to Top