CSC/ECE 517 Fall 2012/ch1b: Difference between revisions
(Created page with "Cohesion is the "glue" that holds a module together. It can be thought of as the type of association among the component elements of a module. Cohesion is related to the Single R...") |
No edit summary |
||
Line 1: | Line 1: | ||
Cohesion | Cohesion refers to the degree that a module performs one and only one function. In this context, a module refers to any logical collection of “program entities” [2]. This logical collection of program entities could be a function, a class, or even a package. As stated earlier, the goal of object-oriented programming is to achieve highly cohesive classes. High cohesion is desired because it increases the likelihood that a module will be comprehendible, reliable, robust, and reusable [3]. Alternatively, a module that exemplifies low cohesion is difficult to comprehend, costly to maintain, and less likely to be reused [4]. The following examples illustrate the different types of cohesion and are arranged from lowest (least desirable) to highest (most desirable). |
Latest revision as of 00:04, 23 October 2012
Cohesion refers to the degree that a module performs one and only one function. In this context, a module refers to any logical collection of “program entities” [2]. This logical collection of program entities could be a function, a class, or even a package. As stated earlier, the goal of object-oriented programming is to achieve highly cohesive classes. High cohesion is desired because it increases the likelihood that a module will be comprehendible, reliable, robust, and reusable [3]. Alternatively, a module that exemplifies low cohesion is difficult to comprehend, costly to maintain, and less likely to be reused [4]. The following examples illustrate the different types of cohesion and are arranged from lowest (least desirable) to highest (most desirable).