26 Introducing Extensions
WHEN YOU PROGRAM in Java, you do not begin from scratch, you “inherit” all the power of the Java class libraries. You also usually inherit the code of your predecessors and coworkers. When you’re not reorganizing or improving this legacy code, you’re extending it. You might say that programming in Java is extension.
If you’ve ever inherited a codebase, you may have grumbled about its quality. But is the new code you’re adding really better? The answer is sometimes subjective, but this chapter reviews a few principles of object-oriented software development that you can use to assess your work.
In addition to normal techniques for extending a codebase, you may be able to apply design patterns to add new behavior. ...