O'Reilly logo

Better, Faster, Lighter Java by Justin Gehtland, Bruce A. Tate

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

Chapter 6. Allow for Extension

Nearly every extreme sports junky has one tool in common. It's a tool that you can't always find at an outdoor shop, although it's the first one you pack for extended river trips or mountain biking journeys. A close friend has used it as a first aid kit for major cuts and others have used it to splint broken bones. I've repaired major gashes in my boat, tightened up my cockpit, and even splinted a broken paddle. I've heard tales of amazing mountain bike repairs, from tires to gear systems.

Of course, the magic tool is duct tape. Like any other aspiring engineer, I stretch duct tape far beyond its intended use. In this chapter, you'll see some techniques that allow your applications to stretch in the same way. Enterprising users apply great code for a variety of purposes, including many the author never considered. If you want to build simpler software, extensibility can keep it from being too simplistic. If you don't allow for extension, you don't have a prayer of meeting the needs of today's sophisticated and rapidly changing customers. Give your customers room to be creative and they'll always surprise you.

The Basics of Extension

Extension is in many ways an awkward topic to write about because it encompasses so many different design principles. I've included it in this book because it's a fundamental capability for good applications. You need extensibility if you decide to apply the first four principles outlined in Chapters Chapter 2 through Chapter ...

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