Object Oriented Software Engineering   View all facts   Glossary   Help
subject > criterion > quality > software quality > cohesion > functional cohesion
Next cohesionlayer cohesion    Upcohesion    Previous cohesioncommunicational cohesion   

functional cohesion
subjectfact 
functional cohesionhas definition A form of cohesion in which modules which together perform a function (a computation that returns a result and has no side effects) are kept together, and everything else is kept out2001-08-30 14:55:40.0
has advantages
  • It is easier to understand a module when you know all it does is generate one specific output and has no side effects
  • It is easier to replace a functionally cohesive module with another that performs the same computation
  • functionally cohesive module is much more likely to be reusable
2001-08-30 14:55:40.0
is a subtopic of 9.2 - Principles Leading to Good Design2001-08-30 14:55:40.0
is achieved when a module only performs a single computation, and returns a result, without having side-effects2001-08-30 14:55:40.0
is a kind of cohesion2001-08-30 14:55:40.0
should be used if possible2001-08-30 14:55:40.0
cohesionhas precedence table
Cohesion typeComments
functional cohesionIf an aspect of a design can be achieved using a functionally cohesive module then it is normally best to do so.
layer cohesionLayer cohesion should typically have higher priority. Dividing systems into layers has been shown to considerably simplify systems.
communicational cohesionCommunicational cohesion, as embodied in the classes of an object oriented system, should have high priority. Here we list it below layer cohesion since modules may access the same kind of data in different layers.
sequential cohesionSequential cohesion is effectively a strong form of temporal cohesion, but is weaker than communicational cohesion since different data types may be involved in the different stages of a sequentially cohesive module.
temporal cohesionTemporal cohesion should typically be considered weaker than other types of cohesion. It is important, but only if the other types of cohesion have been achieved.
utility cohesionUtility cohesion is the weakest kind of cohesion since it serves to group together those parts of the system that do not seem to logically belong anywhere else.
2001-08-30 14:54:55.0
software qualityis hard to assess2001-08-30 14:57:42.0