Search code examples
umlportsequence-diagram

Can you represent a port as a lifeline in UML sequence diagram?


In section "17.3.4.1 Lifeline" of UML Specification 2.5.1, it writes:

"If the name is ‘self’, then the Lifeline represents the object of the classifier that encloses the Interaction that owns the Lifeline. Ports of the encloser may be shown separately even when self is included."

Unfortunately, there is no example of how to show a port in a sequence diagram. Now, does this statement mean that we can represent ports of the class as a lifeline, or is there any other notation to show the ports in a sequence diagram?


Solution

  • we can represent ports of the class as a lifeline ... ?

    A Lifeline represents a ConnectableElement (§17.12.17.4 of formal/2017-12-05). A Port is a Property (§ 11.8.14.3) which is a ConnectableElement (§9.9.17.3), so a Port is a ConnectableElement and the answer is yes

    Ports of the encloser may be shown separately even when self is included.

    This is a precision saying there is no restriction for the ports of the encloser, to avoid possible doubt