O'Reilly logo

Design Patterns Java™ Workbook by 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

Refactoring to Facade

A facade provides an interface, but it does not use a Java interface. Rather, a facade is a class with methods that make it easy to use the classes in a subsystem.

Consider an example from the early days at Oozinoz, when there were not yet standards for GUI development. Suppose that you come across an application that a developer has created to show the flight path of an unexploded shell. Figure 4.1 shows this class. As before, the underscore in the name of the FlightPanel_1 class is a hint that this class, from com.oozinoz.applications, needs refactoring.

Figure 4.1. The FlightPanel_1 class displays the flight path of an unexploded shell.

Aerial shells are designed to explode high in the sky, with spectacular results. But ...

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