Define the concept of "port" in the UML composite structure diagram

In the UML composite structure diagram: what is a β€œport”? And how would you implement it, say, in Java?

+6
java uml
source share
4 answers

I would say that in an OO language such as Java, the concept of a port used by composite structural diagrams is usually implemented as a call to a method of an object-containing object after calling the method of the containing object.

This is a bit like Facade or Delegation , except that the containing object must actually β€œown” the member object.

See the Delegation WikiPedia article for examples of multi-language implementations.

To answer the first part of the question, from the UML user guide (second edition) (admittedly, regarding components):

The port is a clear window to the encapsulated component . In an encapsulated component, all interactions in and out of the component pass through the ports. The outwardly visible behavior of a component is the sum of its ports, no more and no less. In addition, the port has an identifier.

... and from UML distilled (3rd Edition):

Ports allow you to group the required and provided interfaces into the logical interactions that the component has with the outside world.

+6
source share

A port is a connection between your system and other systems (outside your model). http://en.wikipedia.org/wiki/Composite_structure_diagram

It is completely open how and with what technologies the port is implemented. The XML web service will be an example of technology that can be used to implement a port.

+2
source share

I do not think that there is java to display the structure of the composite structure. Usually classifies a diagram for java matching (for example, code generation) to create an application skeleton and a sequence diagram for java to reverse method flows.

Except that all the other participants have just been research projects. Omondo visited the creation of a composite structural diagram from a class, but the port has no equivalent in the project for java.

+1
source share

When any external component requires servicing the component using the interfaces provided to it through the port, then the port delegates responsibility to a certain part of the internal component, for example, to Facade or Delegation templates, but what is the behavior of the port when the component part requires some service using the required interface through the port, does any port behave like a stub or in some other way?

+1
source share

All Articles