functionally cohesive module | can call the services of other modules, but the called modules must preserve the functional cohesion | |
does not have side effects such as updating a database or creating a new file | |
does not interact with the user | |
has example - A module that computes a mathematical function such as sine or cosine
- A module that takes a set of equations and solves for the unknowns
- A module in a chemical factory that takes data from various monitoring devices and computes the yield of a chemical process as a percentage of the theoretical maximum
| |
has example a module that inputs meteorological data from weather stations and satellites and generates an atmospheric model that other systems can use to generate weather forecasts | |
has inputs function parameters, but they can also include files or some other stream of data | |
is a subtopic of 9.2 - Principles Leading to Good Design | |
is a kind of cohesive module | |
returns a simple return value or a more complex data structure | |
cohesive module | can contain sub-modules with different types of cohesion | |
can use the services of other modules without reducing cohesion, as long as the services of the other modules are not doing things that should be in the cohesive module | |
module | has high cohesion if related aspects of a system are kept together in this module, and unrelated aspects are kept out | |
is implemented | |
lacks side effects if it does not modify any data, and does not leave behind any information, other than its result, that would have an effect on other computations | |
component | is reusable if it can be used in several different systems with little or no modification | |
may perform a special-purpose function such as the user interface for a particular system | |