Application Frameworks

Application frameworks have been used successfully on Macintosh and Windows systems, but are just now becoming popular in the UNIX environment. The concept behind an application framework is simple: instead of providing a library that contains small pieces from which an application can be built, an application framework implements an application that is fully functional, except for those parts that are application specific.

Programmers who use such a framework can start their development with an application that already fully implements as many generic features as possible. Such features might include support for on-line help, support for audio input and output, automatic integration with the desktop or other applications in the environment, and so on.

Most application frameworks rely on object-oriented technology to provide as many basic services as possible without limiting the developer's ability to modify the behavior of the basic application model. Because of the way in which frameworks typically work, application frameworks have been described as upside-down libraries.

When using traditional user interface toolkits, applications implement the control flow of the application and call functions provided by the toolkit when various toolkit-level services are needed. In an application framework, a significant portion of the control flow and application-level logic is contained in the library. The library calls functions provided by the application when application-specific behavior is required. Generally, these hooks are supported through the use of inheritance. The framework provides a collection of classes that implement the default behavior expected of all applications. Applications modify these classes to support application-specific behavior by creating subclasses that override the default behavior of the framework, as needed.

The ViewKit Generic Application

[Screenshot of generic application UI]

Using just a few lines of code
(shown below) ViewKit delivers a
fully functional, albeit simple,
Motif application. This generic
application
automatically supports
built-in busy cursors, input blocking,
interruptible tasks, window manager
quit/close protocols, a cached dialog
system, ToolTalk support, and hooks
for context-sensitive help, multi-level
undo, and more...


/////////////////////////////////////////////////
//         ViewKit Generic Application         //
/////////////////////////////////////////////////

#include <Vk/VkApp.h>
#include <Vk/VkWindow.h>

void main ( int argc, char **argv )
{
    VkApp     *app = new VkApp("Generic", &argc, argv);
    VkWindow  *win = new VkWindow("generic");

    win->show();  // Display the window
    app->run();   // Run the application
}


Return to ViewKit Description