Technical ramblings
Monday, August 22, 2005
  Miscellaneous Design Gripe
You can tell when your software design is fucked up, when you have an endless series of interface objects within Java or C++, which are only backed by a single implementation.

Interfaces exist to help support (amongst other things) an abstraction process where the same interface may have multiple implementations; this permits the implementation to be swapped out. For this to work, interfaces *should* be kept as small as necessary, so a new implementation of the interface has relatively little work to perform.

However, if you have only one back-end implementation of an interface, why bother? It's needless complexity for the sake of complexity--and frankly, if later you decide you need an interface, it's easier to add a new interface (or to add new complexity) to simple code than to try to refactor code where the interfaces don't exist quite at the level of abstraction where you needed them.
 
Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home
... where our hero, embedded in the computer industry, rambles on about software development issues which catches his eye or (more likely) annoys the hell out of him...

Name:
Location: Glendale, California, United States

I'm your humble host, a resident of Southern California, an ornery conservative in a liberal land, a software developer who also likes to do woodworking and cook.

Archives
July 2005 / August 2005 / November 2005 / January 2006 / December 2006 / February 2007 /


Powered by Blogger

Subscribe to
Posts [Atom]