Orthogonality is a concept often used to describe modular and maintainable software, but it’s more easily understood by way of a case study. In this article, Jens Dietrich demystifies orthogonality and some related design principles by demonstrating their use in the popular Log4j utility library. He also discusses how Log4j violates orthogonality in a couple of instances and discusses possible workarounds to the issues raised.
The concept of orthogonality is based on the Greek word orthogōnios, meaning “right-angled.” It is often used to express the independence between different dimensions. When an object moves along the x-axis in a three-dimensional space, its y and z coordinates don’t change. Change in one dimension does not cause change in another dimension, which means that one dimension cannot cause side-effects for others.