Let’s reuse the example of the electrical gate controller module. Assume there’s another module that for reporting purposes computes how much electrical power was used to open the gate. It takes the opening ratio, converts it to voltage and then uses some configured engine parameters to compute the power. In such a design, we would violate the High Cohesion pattern, because the knowledge about engine design and usage would be dispersed in two modules. If a developer had adjusted the voltage conversion logic, would he/she remember to adjust the second module as well? If not, a bug would be introduced.
Трамп допустил ужесточение торговых соглашений с другими странами20:46,推荐阅读搜狗输入法下载获取更多信息
This story was originally featured on Fortune.com,详情可参考91视频
(作者为福建省习近平新时代中国特色社会主义思想研究中心特约研究员、集美大学师范学院教授)