Java – define the concept of “port” in UML composite structure diagram

In UML composite structure diagram: what is "port"? How can I implement one, such as Java?

Solution

I will point out that in OO languages like Java, the port concept used in composite structure diagrams (usually) is actually implemented as the method of calling member objects by containing objects after calling methods Contains objects

This is a bit like facade or delegation mode, except that the containing object must actually "own" the member object

For example implementations of multiple languages, see the delegation Wikipedia article

To answer the first part of the question, refer to the UML user manual (version 2) (admittedly related to components):

... and extracted from UML (version 3):

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>