简体   繁体   English

接口如何降低模块之间以及与外部环境之间连接的复杂性?

[英]How interfaces reduce the complexity of connections between modules and with the external environment?

As I read in CHAPTER 13 DESIGN CONCEPTS AND PRINCIPLES 正如我在第13章中所读到的,设计概念和原理

Book: Software Engineering A PRACTITIONER'S APPROACH by Roger S. Pressman,FIFTH EDITION: 书籍:软件工程罗杰·普雷斯曼(Roger S. Pressman)执业者的方法,第五版:

6.A design should lead to interfaces that reduce the complexity of connections between modules and with the external environment

How interfaces reduce the complexity of connections between modules and with the external environment? 接口如何降低模块之间以及与外部环境之间连接的复杂性?

I guess that instead of describing all possible connections thanks to specific types, you simply have to describe them with interfaces and then at the implementation step all you need is to be sure that your type implementing the dedicated interface. 我猜想,不用描述由于特定类型而引起的所有可能的连接,您只需要使用接口来描述它们,然后在实现步骤中,所需要做的就是确保您的类型实现专用接口。

Here two examples: 1) Without using interfaces 这里有两个例子:1)不使用接口

在此处输入图片说明

2) using interfaces 2)使用接口

在此处输入图片说明

Hoping it is clear, 希望很清楚,

Regards, 问候,

EBR EBR

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM