Pages

Friday, November 08, 2013

Orthogonality

In computing, the term orthogonality refers to the degree of interdependence or decoupling between the modules. Two modules are orthogonal if changes in one does not affect another. This makes it easier to modify one without affecting any other components of the system. Non-orthogonal systems, on the other hand, are difficult to change and control.

Orthogonality adds up the value of overall system with two main benefits:

Increased Productivity

In orthogonal systems, changes are localized within the module itself. This helps to reduce the development and testing time. Also, the effort required to write self-contained blocks is less. Smaller components are easier to reconfigure and re-engineer, which also makes them reusable.

Orthogonality adds more functionality per unit. Assume we have one component which does M  distinct things and another component which does N things. In orthogonal systems, we get M×N different things. But in non-orthogonal systems, some things may overlap thereby reducing the total number.

Reduced Risk

Diseased sections of code are isolated in orthogonal systems and they are less likely to spread symptoms to other modules. Orthogonality also helps to slice and transplant them to healthy ones. The resulting system is less fragile since the changes affect only a small area.

- summary of Orthogonality, from The Pragmatic Programmer: From Journeyman to Master

No comments:

Post a Comment