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

A Classic Example: GUI Mediators

You will probably most often encounter the MEDIATOR pattern when you develop an application with a GUI. Such applications tend to become thick, gathering code that you can refactor into other classes. The FlightPanel class in Chapter 4, Facade, initially performed three roles.

Before you refactored it, this class acted as a display panel, as a complete GUI application, and as a flight path calculator. After refactoring, the application that launches the flight panel display became simple, containing just a few lines of code. Large applications, however, can remain complex after this type of refactoring, even when they contain just the logic that creates components and that arranges for the components' interaction. ...

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