zoukankan      html  css  js  c++  java
  • functional cohesion

    Computer Science An Overview _J. Glenn Brookshear _11th Edition

    A weak form of cohesion is known as logical cohesion. This is the cohesion within a module induced by the fact that its internal elements perform activities logically similar in nature. For example, consider a module that performs all of a system’s communication with the outside world. The “glue” that holds such a module together is that all the activities within the module deal with communication. However, the topics of the communication can vary greatly. Some may deal with obtaining data, whereas others deal with reporting results.

    A stronger form of cohesion is known as functional cohesion, which means that all the parts of the module are focused on the performance of a single activity. In an imperative design, functional cohesion can often be increased by isolating subtasks in other modules and then using these modules as abstract tools. This is demonstrated in our tennis simulation example (see again Figure 7.3) where the module ControlGame uses the other modules as abstract tools so that it can concentrate on overseeing the game rather than being distracted by the details of serving, returning, and maintaining the score.

    In object-oriented designs, entire objects are usually only logically cohesive because the methods within an object often perform loosely related activities— the only common bond being that they are activities performed by the same object. For example, in our tennis simulation example, each player object contains methods for serving as well as returning the ball, which are significantly different activities. Such an object would therefore be only a logically cohesive module. However, software designers should strive to make each individual method within an object functionally cohesive. That is, even though the object in its entirety is only logically cohesive, each method within an object should perform only one functionally cohesive task (Figure 7.7).

  • 相关阅读:
    服务器响应状态码
    细说同域-同父域-跨域
    细说Ajax跨域
    为SQL缓存通知启用数据库
    使用PATINDEX()判断含有[A-Z]、[a-z]、[0-9]之外的字符
    记一次SQLServer的分页优化兼谈谈使用Row_Number()分页存在的问题
    谈谈如何在面试中发掘程序猿的核心竞争力
    “属性”与“特性”区别
    【转】安卓手机无法安装软件的原因总结
    【转】自学android半年,已从.net转型成android程序员
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6053906.html
Copyright © 2011-2022 走看看