Reusability is not an issue
Reuse is one of the often mentioned features, or advantages, of object oriented programming (OOP). Although I am a diehard fan of OOP, I must admit: We failed with reusability. It doesn’t work the way we were promised. Implementing reusability the way people traditionally tend to think of reuse, is very hard and time consuming. The idea that the possibility to reuse just appears if we object orient our system right, is just plain wrong. Implementing reuse is seldom done with success. And the main problem is that the idea that everything should be reusable misleads us to make wrong design decisions, making us over-generalize everything, hoping that we one day can harvest the values of reuse, which we never do.
That being said, I have realized that there is something about reusability that OOP is very good at, it’s just that we have been a bit mislead about the general conception of what reusability really is.
The classical definition of Reusability
Traditionally, reuse has been about the reuse of components. Big components. And typically third-party components. Precompiled, general purpose components to solve every task. This is reusability at an architectural level. In a not so far past, when OO-technologies emerged, the industry were dreaming about a future where programming was reduced to assembling standardized components. Now that would have been something! But as we all know, it just didn’t happen.
Still many people believe in this classical idea of “the grand reuse” at some level, but most of the time it just doesn’t work.
It’s time to say: Reusability is not an issue. At least not this kind of reusability. Most projects should not spend good time and money on generalizing everything just a bit more, hoping to get some value from reusability somewhere in the future. Because most often, you won’t.
The actual reuse in OO-systems
So, what’s my take on reusability? Reuse happens a lot! Or at least it should. But it is all happening at the code level. As a developer you reuse when you refactor out common functionality. If your code is called from more than one place, it is being reused. Reuse is the opposite of copying code. Reuse is about factoring out common functionality. Reuse is about writing less code. This should be in the back of every developer’s head at all times. Reuse should just happen. When it comes to this kind of reuse, OO is an excellent tool. Good OO systems implements a lot of reuse. Good developers reuse a lot.
It’s time for business to stop believing the hype, and to start realizing that it’s the quality of their developers that really matters. It’s the developers that implement reuse, and produce the values of it in form of less code, better quality, and more flexible code.
- Tore Vestues


How to measure reusability
June 3rd, 2009 at 6:10 (299)