Extensibility is how easy it is to take some code, a library, a package, or an application and extend it.  Normally it is done by extending an interface provided by the original developer.  Code that was never designed to be extended will have few, if any interfaces.  High end library code will be interface rich, with users able to provide their own implementations or extend existing classes with some minor customisations using inheritance.

Tip: One school of thought says that interfaces should be designed in from the beginning.  Not so - often developers over-interface applications too early, before interface candidates are clear.  Even when there is only one class that implements an interface, An interface prevents some IDE code “open declaration” assist features from working, slowing  development and making debugging difficult.  It is easy to push a concrete class out into an interface later.

Unless you're writing reusable libraries, interfaces tend to be overused, adding an unwanted layer of abstraction when you need to find the concrete class behind the facade.  At the very least there will be two class files (one implementation, one interface) to be coded instead of one before anything can be executed.  

Tip: A telltale sign of overused interfaces is only having one implementing class for each interface.  Sure, you may need to create a mock class for a web service one day, but do the work later, when you need it.

blog comments powered by Disqus