微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java – 在UML复合结构图中定义“端口”的概念

在UML复合结构图中:什么是“端口”?我会如何实现一个,比如说 Java

解决方法

我会提出,在像Java这样的OO语言中,复合结构图所使用的端口概念(通常)实际上实现为在对方法进行调用之后由包含对象调用成员对象的方法.包含对象.

这有点像FacadeDelegation模式,除了包含对象实际上必须“拥有”成员对象.

有关多种语言的示例实现,请参阅Delegation WikiPedia文章.

要回答问题的第一部分,请参阅UML用户手册(第2版)(诚然与组件有关):

A port is an explicit window into an encapsulated component. In an encapsulated
component,all of the interactions into and out of the component pass through ports. The externally visible behavior of the component is the sum of its ports,no more and no less. In addition,a port has identity.

…并从UML提取(第3版):

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

原文地址:https://www.jb51.cc/java/121207.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐