gpt4 book ai didi

interface - 接口(interface)如何用于组件图模块之间的通信?

转载 作者:行者123 更新时间:2023-12-03 22:26:59 25 4
gpt4 key购买 nike

Complexity of the interface is another factor affecting coupling. The more complex each interface is, the higher will be the degree of coupling



上面引用的句子来自 A concise Introduction to Software Engineering ,Chapter 6: Design

不知道该接口(interface)如何用于组件图模块之间的通信?

最佳答案

接口(interface)由组件实现(公开)。

其他组件引用此接口(interface)并使用它们来创建对象、调用方法等。组件与其使用的接口(interface)之间的这种关系称为 依赖 .

系统中的接口(interface)越多,系统就越复杂。

实际上,影响复杂性的因素远远超过纯接口(interface)数量是刚刚提到的依赖关系的性质和结构。一个坚实的系统架构具有较少的依赖关系,以清晰、干净和简单的方式组织。

特别危险的是所谓的循环依赖 .应该完全避免它们。

一个简单的例子:
enter image description here

关于interface - 接口(interface)如何用于组件图模块之间的通信?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23682365/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com