Modularity Flashcards
what is module
each of the set of standardized parts that are used to create more complex structure
how is modularity being measured
by using three factors - cohesion, coupling and connascence
what is cohesion
cohesion is an indication of the extent to which parts of a module should be kept together, inside the module
what is coupling
coupling is an indicator of how much calls a module needs to make to another module so as to be able to perform any meaningful transaction
what are the varieties of cohesion
functional (best), sequential, communicational, procedural, temporal, logical, coincidental (worst)
what is LCOM measure of cohesion
LCOM or Lack of Cohesion Measurement is a part of Chidamber and Kemerer suit of Object - oriented metrics. It represents the sum of the methods not shared via sharing of a common field; so for example, in a class if there are 3 out 10 methods that shares common attribute, would have lower LCOM score (and therefore less cohesion, which is usually bad) than the class that has 7 out of 10 methods that uses the shared common attribute.
what is afferent coupling
number of inbound calls
what is efferent coupling
number of outbound calls
what is abstractness
the ratio between number of abstract methods to concrete method is the measure of abstractness
what is instability
the ratio between efferent coupling / sum of afferent & efferent coupling; higher value indicates that there are lot of outbound calls that a class makes, thereby making it susceptible to breakage in case any of the called classes break
what is distance from main sequence
distance from main sequence = |abstractness + instability - 1|; if abstraction scores high, a class falls to zone of uselessness, if instability is very high then the class falls to zone of pain
what is connascence
two components are connascent if change in one, requires changing in the other, to ensure that the system functions correctly
what is the difference between static and dynamic connascence
static connascence indicates source code level coupling and dynamic connascence indicate runtime coupling
what are the variety of static connascence
static connascence indicates the degree to which multiple components agree on the name, type, meaning, position, algorithm of a given entity
what is the use of connascence as a tool
connascence is a measure that needs to be minimized across module boundaries, by the use of encapsulation; the connascence within a module should be made high