Modularity

#

Modularity is a concept used in many disciplines that deal with complex systems. There are two related ideas under the concept of modularity.

#

In a top-down approach, a complex system should be decomposed in a way that makes the parts independent from each other in order to prevent the propagation of change and error. This is related to the idea of black-box abstraction.

#

In a bottom-up approach, we want to be able to easily rearrange the parts of the system to change its behavior. The metalinguistic abstraction is one technique to create modular systems in this sense.

#

Those two ideas are related because they depend on the type of coupling between the parts of the system.

#

Propagation of Change

#

One reason to create modular systems to prevent the propagation of change. If a change in a part of a system generates one or more changes in other parts, we make the system harder to maintain. We want to be able to evolve the parts of our system independently.

#

In Notes on the Synthesis of Form, Christopher Alexander explains why such decoupling is desirable and how to model design problems to maximize this decoupling.

#

The first axiom of the Axiomatic Design method is to keep functional requirements uncoupled in the design. We want to be able to adjust the design parameter of a requirement without affecting other requirements.

#

David Parnas's concept of "information hiding" is similar. Parnas recommends isolating the design decisions into different software modules so we can independently change them as the requirements change.

#

Propagation of Errors

#

In software engineering, we also create modules to contain faults and prevent failures to propagate.

#

We can deploy our systems in different geographical regions, on different servers, in different processes...

#

What Modularity Is Not

#

Not all decompositions of a system are modular. One could break down a system into small parts that are not independent from each other and that cannot be rearranged easily.

#

A module is sometimes defined as a collection of parts that are strongly connected among themselves (high cohesion) but weakly connected to the parts in other modules (loose coupling). However, it makes the definition of modularity non-recursive. It is not clear to me why you would not want the same property inside and outside the module.

◆◆◆