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

Get Design Patterns Java™ Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.