Port (UML)

from Wikipedia, the free encyclopedia

A port (Engl. Port ) is a model element in the Unified Modeling Language (UML), a modeling language for software and other systems.

A port is a structural feature of a classifier and specifies a kind of gate that represents an opening between the environment in which the classifier is embedded and the interior of the classifier. A port is the specification of an interaction point on the envelope of a classifier.

Like any structural characteristic, a port has a classifier as a type. This classifier can be an interface or a class . This means that each port also indirectly has a number of offered and required interfaces . The number of interfaces offered corresponds to the interfaces offered, which the type of port offers. Similarly, the interfaces required for the port are made up of the interfaces required by the type of port.

UML2 differentiates between service and non-service ports . A service port belongs to the publicly visible functionality of the classifier that owns the port, while a non-service port is required for the specification of the classifier, but is not externally visible.

Messages that arrive at a port from outside are normally forwarded to elements inside the classifier to which it belongs. If the classifier has its own behavior , the port can also forward messages directly to it. This type port calls the UML 2 behavior Sport (Engl. Behavior port ).

notation

A port is graphically represented as a small square, either directly on the edge of the rectangle that represents the owner of the port, or close to the edge inside the rectangle if it is a non-service port .

Example of a component with two ports

The figure on the left shows a component with two service ports . The port with the name Management-Portoffers an interface Betrieb überwachen. The second port is unnamed. He offers the interface E-Mail empfangenand needs the interface E-Mail versenden.

Example of an active class with a behavior port

The notation for a behavior port differs from the notation for other ports in that, in addition to the port, a status symbol is drawn inside and a connecting line from the port to the status symbol is drawn on the edge of the classifier. The figure on the left shows an example.

Differences to UML 1.4

The model element port was newly introduced in UML2.