level | name | what it is | |
---|---|---|---|
best | 5. | Data | Parameter lists. |
4. | Stamp | "Named common," that is, public variables shared only by those procedures that need to use them. | |
3. | Control | Flags passed between procedures to indicate what sections of code they should execute (what functions they should perform). | |
2. | Common | All procedures access all public variables. | |
worst | 1. | Content | Procedures modify each others' internal variables or code. (Assembly language). |
In some rare instances, Stamp Coupling may be used in place of Data Coupling when efficiency problems make parameter passing too slow or large. This is, however, a rather unsatisfactory state of affairs.
level | name | what it is | |
---|---|---|---|
best | 6. | Functional | A procedure that accomplishes one clear function. Examples: a quicksort, a square root routine, a Roman-numeral evaluator. |
Informational | A group of procedures that work on the same data structure. Example: a module that implements an abstract data type. | ||
5. | Communicational | A series of operations as in procedural cohesion, but applied to the same data. Example: a procedure that reads the input stream and sorts it. | |
4. | Procedural | A series of operations that have something to do with each other, in terms of the overall problem being solved. Example: a procedure that reads the input stream, breaks it intoRoman numerals, and sorts the roman numerals. | |
3. | Temporal | A series of operations related in time (only). Common examples: a procedure that initializes all data structures used in a program, one that opens all files, etc. These operations typically have rather little to do with each other, but have strong connections with other parts of the program. (For example, a file must be opened here before it can be used in other parts of the program.) | |
2. | Logical | A set of related operations, where the caller chooses which to invoke. Example: edit(op, string1, string2) where op == 1 means replace, op == 2 means delete, and so forth. Historically this has sometimes been the poor man's form of Informational Cohesion but is no longer necessary. | |
worst | 1. | Coincidental | No particular relation among operations. Common example: a large program arbitrarily hacked into "modular" sections. |
Department of Computer Science
University of California at Davis
Davis, CA 95616-8562