耦合和凝聚力 [英] Coupling and cohesion

查看:294
本文介绍了耦合和凝聚力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想耦合和凝聚力的概念归结为一个简明的定义。有人可以给我一个简短易懂的说明(不是在这里维基百科和的here )?他们如何互动?

I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia here and here)? How do they interact?

感谢。

任何人有一个良好的,简短的例子?

Anybody have a good, short example?

推荐答案

耦合


  • 宽松:你和在便利店的家伙。您可以通过一个明确的协议进行通信,以实现自己各自的目标 - 你付出的钱,他可以让你走出与奇多袋。你们任何一个可以在不中断系统所取代。

  • Loose: You and the guy at the convenience store. You communicate through a well-defined protocol to achieve your respective goals - you pay money, he lets you walk out with the bag of Cheetos. Either one of you can be replaced without disrupting the system.

紧:你和你的妻子

凝聚力


  • 低:便利店。你去那里一切从气体牛奶银行ATM。产品和服务有什么共同之处,并让他们在同一个地方的便利可能不足以抵消在质量和成本的降低因此而增加。

  • Low: The convenience store. You go there for everything from gas to milk to ATM banking. Products and services have little in common, and the convenience of having them all in one place may not be enough to offset the resulting increase in cost and decrease in quality.

高:奶酪店。他们出售的奶酪。没有其他的。当谈到奶酪虽不能打败他们。

High: The cheese store. They sell cheese. Nothing else. Can't beat 'em when it comes to cheese though.

这篇关于耦合和凝聚力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆