沟通凝聚力
模块之间存在耦合和内聚。好的。存在功能和沟通的凝聚力。功能内聚是按功能分组。好的。通信内聚力是按输入/输出数据分组.. 嗯.. 不行。任何人都可以解释一下什么是沟通凝聚力或/并提供示例(任何语言,但最好是 Java)?
There are coupling and cohesion for modules. OK. There are functional and communication cohesion. Functional cohesion is grouping by functionality. OK. Communication cohesion is grouping by input/output data.. Hm.. Not OK. Can any explain me what is communication cohesion or/and provide example (any language, but Java is preferable)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,它被称为沟通凝聚力。
我发现以下解释很清楚:
为了与其他类型的内聚进行比较,引用的文章似乎很清楚。
正如示例所示,与沟通内聚相比,更喜欢功能内聚(甚至顺序内聚)非常重要。
First of, it's called Communicational Cohesion.
I found the following explanation clear:
For a comparison with the other types of cohesion, the referenced article seems really clear.
As the example states, it's important to prefer functional cohesion (or even sequential cohesion) over communicational cohesion.
这只是我的解释,但我想说“通信凝聚力”意味着使用相同数据的代码被放置在一起,并与该数据放在一起。 “Together”可以意味着它们在同一个包或JAR中,这意味着优点主要在于可维护性。或者它可能意味着它位于相同的硬件或相同的 LAN 上,这具有性能和安全优势。
This is just my interpretation, but I'd say that "communication cohesion" means that code that works with the same data is placed together, and together with that data. "Together" can mean that it's in the same package or JAR, which means the advantage is mainly in maintainability. Or it can mean that it lives on the same hardware or the same LAN, which has performance and security benefits.
据推测,通信凝聚力涉及开放标准协议和格式的使用。例如 HTTP、JSON 等。
ETA:维基百科说:
通信凝聚力是指模块的各个部分由于对相同数据进行操作而被分组(例如,对相同信息记录进行操作的模块)。
Presumably communication cohesion involves the use of open standard protocols and formats. e.g. HTTP, JSON, etc.
ETA: Wikipedia says:
Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g. a module which operates on the same record of information).