Quantcast
Channel: Geekswithblogs.net
Viewing all articles
Browse latest Browse all 6441

Wherefore art thou Orthogonal?

$
0
0

Originally posted on: http://geekswithblogs.net/AnneBougie/archive/2013/09/10/wherefore-art-thou-orthogonal.aspx

Being a developer, I am always reading about orthogonality of things. Modules need to be orthogonal. I have always been confused by that term. The dictionary has several definitions of orthogonal:
  1. intersecting or lying at right angle
  2. having perpendicular slopes or tangents at the point of intersection
  3. having the integral of the product of each pair of functions over a specific interval equal to zero
  4. having the scalar product equal to zero

How do these definitions have anything at all to do with programming? This is almost as unhelpful as the next definitions, which presume you know the meaning of the word you are looking up. Aren't you looking up a word because you don't know the meaning of it?

  1. having a matrix that is orthogonal
  2. composed of mutually orthogonal elements

I always kind of thought I knew what it meant, but couldn't really explain the concept to someone else. I think if you can't explain a concept to someone who doesn't know it, you don't really know it yourself.

Now, I finally get it!

Here is the definition that finally made the lightbulb go off for me (from The Pragmatic Programmer): Two or more things are orthogonal if changes in one do not affect changes in any of the others.

So, what does this mean for designing an application? It means that you have layers of abstraction between the different parts of your system. It is the basic concept behind many of the programming axioms we all know and love. The following object-oriented concepts are really just describing orthogonality in software design:
  • Encapsulate what varies.
  • Favor composition over inheritance.
  • Program to interfaces, not implementations.
  • Strive for loosely couple designs between objects that interact.
  • Depend on abstractions. Do not depend on concrete classes.

So, let us go orthogonally where no man has gone before!. No, where many others have gone and achieved great success doing so. Somehow that doesn't quite have the same ring to it, but it's probably closer to the mark.



Viewing all articles
Browse latest Browse all 6441

Trending Articles