pplication code is not like wine; it does not ferment into a more pleasurable substance as time passes; rather, it does the opposite, and grows progressively more unwieldy as time goes by. Such code is known as "legacy," and my purpose is to discuss the use of polymorphism as a means to enable effective reuse of legacy code for both present and future modifications.
Since the onset of object-oriented (OO) programming, the reusability of code has been a much-discussed topic and a major goal of most OO development efforts. Reuse of code is a noble achievement, for well-known reasons. Code doesn't have to be physically written more than once (or cut and pasted into multiple places). Code can be maintained in a single location, and the benefits of bug fixing, optimization, revisions to error handling, and enhanced feature are experienced wherever the code is referenced.
Over the course of time, effective reuse decreases development and support costs as code libraries within an organization grow and are reused across applications. The advantages of reuse are clear, and so logically, it is strongly pursued in new development efforts. However, what is not so evident is how to maintain the benefits of reuse as code ages.
|