Pattern:
View Handler


Author

Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal

Intent

"The View Handler design pattern helps to manage all views that a software system provides. A view handler component allows clients to open, manipulate and dispose of views. It also coordinates dependencies between view and organizes their update." (Buschmann, F., R. Meunier, H. Rohnert, P. Sommerlad, and M. Stal. Pattern-Oriented Software Architecture: A System Of Patterns. West Sussex, England: John Wiley & Sons Ltd., 1996)

Motivation

The idea of the View Handler pattern is to separate the management of views from the code required to present or control specific views. A view handler component manages all views that the software system provides. It offers the necessary functionality for opening, coordinating and closing specific views, and also for handling views--for example a command to tile all views, that is, arrange them in an orderly pattern. Specific views, together with functionality for their presentation and control, are encapsulated within separate view components--one for each kind of view. Suppliers provide views with the data they must present. The View Handler pattern adapts the idea of separating presentation from functional core, as proposed by the Mode-View-Controller pattern. It does not provide an overall structure for a software system by itself--it only removes the responsibility of managing the entirety of views and their mutual dependencies from the model and view components. The pattern gives this responsibility to the view handler. For a more detailed Motivation description for this pattern see: Buschmann, F., R. Meunier, H. Rohnert, P. Sommerlad, and M. Stal. Pattern-Oriented Software Architecture: A System Of Patterns. West Sussex, England: John Wiley & Sons Ltd., 1996.

Known Uses

This pattern has been used on the following systems: Macintosh Window Manager interface has window allocation, window display, mouse location, window movement and sizing, and update region maintenance functions. The window manager is a low-level view handler component as it only provides support for handling individual windows. (Apple Computer Inc., Inside Macintosh, Volume I, Cupertino, CA, 1985.) Microsoft Word. This work-processing system offers functions for cloning, splitting, and tilting windows, and bringing an open window to the foreground. Quitting Word closes all open windows, etc. (Microsoft Corporation, Microsoft Word, Users Guide, 1993.)

See Also

Model-View-Controller and Presentation-Abstraction-Control patterns

Thumbnail

Keywords

Model-View-Controller pattern, Presentation-Abstraction-Control pattern, View Handler pattern, Buschmann patterns, design patterns, manage views

Business Domains

graphicsinteractive applications with a flexible human-computer interfacewindowing systems

Problem Forces

changes to the user interface should be possible at runtimeneed multiple views of the functionality of the underlying applicationpermit users to work with an application in different waysthe display and behavior of the application must reflect data manipulations immediatelythe same information is presented differently in different windowsupgrades of windowing system requires changes to your system

Benefits

exchangability of look and feelpluggable views and controllerssupport for many kinds of changesynchronized views

Liabilities

can be expensive on system resources if large volume of datadata transformation overheadpotential for excessive number of updatesrestricted applicabilityrestricted efficiency

Implementation Files

Simple implmentation of the pattern - ViewHandler. ViewHandler.javaSimple implmentation of the pattern - Supplier. Supplier.javaSimple implmentation of the pattern - SpecificView. SpecificView.javaSimple implmentation of the pattern - AbstractView. AbstractView.javaSimple implmentation of the pattern. viewhandler.h



Generated on Fri Oct 20 10:51:58 GMT+02:00 2000 by Framework Studio