高内聚低耦合,是软件工程中的概念,是判断软件设计好坏的标准,主要用于程序的面向对象的设计,主要看类的内聚性是否高,耦合度是否低。目的是使程序模块的可重用性、移植性大大增强。通常程序结构中各模块的内聚程度越高,模块间的耦合程度就越低。内聚是从功能角度来度量模块内的联系,一个好的内聚模块应当恰好做一件事,它描述的是模块内的功能联系;耦合是软件结构中各模块之间相互连接的一种度量,耦合强弱取决于模块间接口的复杂程度、进入或访问一个模块的点以及通过接口的数据。
图1:应用高内聚和低耦合的原则在企业系统架构的应用和领域层中是特别至关重要的。
Figure 1: Applying the principles of high cohesion and low coupling is especially critical within the application and domain layers of an enterprise system architecture.
应用程序常常没有嵌入高内聚和低耦合的原则的原因与现实的软件开发过程有关。
The reason that applications frequently fail to embody the principles of high cohesion and low coupling relates to real-world software development processes.
这两个职责分配原则在完成良好的面向对象设计的方面扮演了主要角色:高内聚和低耦合。
Two responsibility assignment principles play a major role in achieving good object-oriented design: high cohesion and low coupling.
应用推荐