O'Reilly logo

Design Patterns in Java™, Second Edition by William C. Wake, Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required