Sunday, January 01, 2006 

Unifying Concepts

While looking at some AOP Patterns today, a story came back to my mind. Unfortunately I can't seem to remember where I've read it, or heard of it. Maybe some of you guys can help me here :-).
It's about a martial art master, and he says something like: "Years ago, I discovered there were only three basic techniques, and I focused my practice on those techniques. By doing so, I realized there were only two basic techniques, and kept practicing those. Finally, I realized there is only one basic technique."
In software design, we have many principles and techniques, and even different paradigms, but when you practice them long enough, you start to see some sort of basic, unifying concept.
Consider AOP: AOP is built around the principle of Separation Of Concerns. When you apply AOP techniques, you move each crosscutting concern into a self-contained unit, and away from the remaining code.
Consider design for extendibility: when you design for extendibility (e.g. through use of inheritance as a technique) you provide hot spots in your code, so that new functionalities can be added by adding new, self-contained units, instead of changing existing units (which won't then be, by definition, self-contained).
Information hiding is another way to structure software in self-contained units, this time by looking for stable services, shielding other parts from internal details, which is what makes the unit self-contained (or, using the OO terminology, encapsulated).
The list goes on: low coupling / high cohesion, stepwise refinement, divide and conquer, structured programming, functional decomposition, all providing guidance for the single, fundamental act of software design: partitioning knowledge.
As software is not shaped by physical constraints, we are free to impose any kind of structure (including very cahotic structures) on our creations. Partitioning in self-contained units is the ultimate goal of most [all?] design paradigms, principles, and techniques. This seems largely a consequence of the way the human mind works. There is probably something deeper about this, but I haven't mastered it yet :-).
BTW guys: Happy New Year !!!