Sean Kelly*
NOAA Forecast Systems Laboratory, Boulder, Colorado
Thirteenth International Conference on Interactive Information and Processing Systems (IIPS) for Meteorology, Oceanography, and Hydrology, 2 - 7 February 1997, Long Beach, CA.
Table of Contents
The Forecast Systems Laboratory (FSL) has been engaged in the development and testing of a series of prototype workstations for use in the modernized National Weather Service (NWS) forecast offices. The central element of the latest system, WFO-Advanced, is the two-dimensional forecaster workstation known as D2D (MacDonald and Wakefield, 1996). Using a new capability in the D2D system, an extension framework, local forecasters and programmers in NWS offices can develop their own extensions to the display system. The extension framework is an object-oriented interface that makes local extensions possible. Such extensions could enable D2D users to display special kinds of data, interactively locate information in geographic databases, compute storm directions, and more.
This paper describes the D2D extension framework, compares it to other types of frameworks, and discusses its future directions.
FSL deployed the extension framework using the C++ language. Because most of the D2D software was implemented with an object-oriented (class and object) design, the developers wanted extensions to be similarly implemented. We chose to use a framework approach. A framework comprises several cooperating classes that specifies an architecture for an application (Gamma et al., 1995). An advantage of using a framework is that extension developers do not need to make architectural decisions for their extensions; the framework imposes a limited set of possible stimuli and responses upon local extensions.
Because forecasters perform operational meteorology on the D2D system, the display software must be robust. Thus, we needed a way to prevent bug-prone or poorly implemented local extensions from crashing the display system. We run extensions as processes separate from the processes that compose the core of the D2D display. If an extension crashes, it will terminate its process, allowing the display processes and other extension processes to continue to run. Of course, there is still the danger that a bug-prone extension may run out of control and consume the computer's CPU, disk, or network resources which must be shared by the core display software. To date, we have built no safeguards against this possibility.
We also made use of several design patterns in implementing the extension framework. Design patterns are a recent concept in object-oriented software construction that encapsulates a recurring software problem, solution, consequences, and implementation hints and examples (Gamma et al., 1995). Design patterns helped simplify the software engineering task by providing ready-made class designs directly applicable to our challenge of making the extension framework. For example, we applied the pattern Factory Method (Gamma et al., 1995) to solve the problem of creating the correct kind of extension object upon the forecaster's request. We applied the pattern Half Object+Protocol (Meszaros, 1995) to solve the problem of representing a depictable object (an object that holds and displays data) in two different processes.
We made the extension framework easy to use by simplifying the compiling, linking, and integration of extensions. This was achieved using the following concurrent strategies:
- The framework provides default behavior for extensions that performs the correct actions in most cases. Local extension developers augment or replace only as much behavior as necessary.
- The framework library provides its own main routine.
- The D2D software reads configuration information stored in plain text files; part of this information shows where extensions should appear in the D2D menus. An extension can be added by merely updating these files---there is no need to recompile any of the core D2D software.
In addition, more than one extension may reside in the same process space (for example, to share code). Extension developers also have access to a user interface library, where they can display dialog boxes containing Motif-style widgets as separate, floating windows.
To create an extension, local extension developers make use of a number of C++ classes in the extension framework. Each of these classes represents a key extension concept. This section describes these concepts and their representative classes.
Forecasters load products, such as satellite images or contour pressure plots, into the main D2D display. Products are represented by objects called depictables. An interactive depictable is a kind of depictable used by extensions.
Interactive depictables are half-objects shared between the core D2D software which draws them and the extension which manipulates their contents. They are indexed either by frame number or by frame time, since each frame in a displayed loop has a time index. Interactive depictables contain editable elements (described in the next section), and are the canvas onto which an extension draws elements, and on which the forecaster interacts with the elements.
The class InteractiveDepictableExt represents the extension half of the half-object. Local extension developers use the method newElement to add or change an editable element in the depictable. There are also methods to query and remove elements, and methods to query the frame and time index of the depictable.
Editable elements are on-screen objects visible to the forecaster, which can be moved, reshaped, or deleted. They appear on the D2D display as points, lines, polygons, and polylines (unclosed polygons), and may have text annotation. Extensions may prevent editing of any of its elements. If an extension allows editing of some elements, the vertices of the elements appear with markers that the forecaster uses as editing handles. A family of classes related through inheritance represents editable elements. Figure 1 shows the class hierarchy; the leaf classes are available to the developer.

Editable elements may be used to depict any kind of data: isobars may be a series of polylines; storm centroids may be points; warning areas may be polygons; and so forth. Extension developers place editable elements by specifying latitude and longitude, and the D2D software automatically draws them in the correct place in relation to the map background.
Class Extension represents an abstract extension. To make a local extension, a developer derives a new class from class Extension, and overrides the virtual methods as necessary. The relevant parts of the class declaration include:
1 class Extension {
2 public:
3 virtual ~Extension();
4 bool isActive() const;
5 void deactivate();
6 virtual void activeStateChanged(bool isActive);
7 short activeIntDepictIndex() const;
8
9 virtual void editedPoint(EditablePoint*, bool);
10 virtual void editedLine(EditableLine*, bool);
11 virtual void editedPolygon(EditablePolygon*, bool);
12 virtual void editedPolyline(EditablePolyline*, bool);
13 virtual void deletedElement(EditableElement*) {}
14 virtual void handleIntDepictSeqChanged(
15 SeqOfPtr< InteractiveDepictExt* > deletedDepicts,
16 SeqOfPtr< InteractiveDepictExt* > oldDepicts,
17 SeqOfPtr< InteractiveDepictExt* > newDepicts
18 );
19 protected:
20 Extension( omitted );
21 const SeqOfPtr<InteractiveDepictableExt*>&
22 interactiveDepictables() const;
23 InteractiveDepictableExt* intDepictForTime();
24 };
The details of the constructor parameters on line 20 are beyond the scope of this paper, and are therefore omitted. The next section describes the extension class in detail. Note that the class itself is not abstract in the C++ sense (it has no pure virtual methods).
To emphasize that developers must derive from class Extension, note that the constructor on line 20 is protected. As a result, only derived classes may create derived extension objects. For example, a simple---yet complete---extension which does nothing follows:
class SimpleExtension : public Extension {
public:
SimpleExtension( omitted ) : Extension ( omitted ) {}
};
Lines 4--6 of class Extension deal with the active state of an extension. Only one extension may be active at a time; forecasters who load more than one extension choose one to be active by using a pop-up menu (or the middle mouse button) on the main D2D display. Extensions can take action when they become active by overriding the virtual method activeStateChanged. For example, the WarnGen extension (which assists the forecaster in generating warnings) displays its dialog box when it becomes active, and hides the box when it becomes inactive.
Lines 9--12 deal with changes to editable elements. As stated earlier, extensions draw on the screen by creating editable elements in their interactive depictables. Whenever the forecaster changes an editable element, the extension is notified through these methods. For example, if the forecaster moves a line created by the extension, the method editedLine is called with a pointer to the EditableLine object that the extension created. If the forecaster deletes a vertex from a polygon, editedPolygon is called. If a forecaster creates a new editable element, the boolean parameter to these methods is true; if it were an element that the extension created earlier, the parameter is false.
By overriding the definitions of these functions, the extension can provide any kind of behavior necessary. As an example, the WarnGen extension uses points in a frame sequence to mark the location of a storm. If the forecaster moves a point in one frame, the editedPoint function computes a new storm track and adjusts the locations of points in other frames accordingly, based on computed velocity and frame times.
Line 13 is a method that is called when the forecaster deletes an editable element. As shown, the default behavior is to take no action. Extension developers may override the behavior with any other action they desire.
The extension framework represents a sequence of on-screen frames by a sequence of interactive depictables. As time passes, the frame sequence changes. For example, the forecaster may change the length of the frame sequence, or new data may arrive that cause the time indices of the frames to shift (auto-update). In order to convey these events to an extension, the method on lines 14--18, handleIntDepictSeqChanged, notifies an extension whenever the sequence of interactive depictables changes. It is called with three sequences of pointers to interactive depictables, which are either
- about to be deleted. If the forecaster shortens the sequence, the earlier depictables are passed in here. For the auto-update case, it is always the first depictable previously at the beginning of the frame sequence.
- old. These are depictables that may have changed their frame index, but were otherwise already known to the extension.
- new. These are depictables that just got created. For the auto-update case, it is the latest, new depictable.
Figure 2 shows how the auto-update case works. In this figure, we have a four-frame sequence, with four interactive depictables. The handleIntDepictSeqChanged method will be called with one pointer to the interactive depictable to be deleted, three pointers to the old depictables, and one pointer to the new depictable.

The reason for all this complexity is that the extension may have to perform some sophisticated processing in light of the new time indices and/or new depictables. As an example, consider again a storm tracking extension using points to locate a storm in each frame. The new depictables will be empty, so the extension will have to compute the new storm location in those frames and create the points in the right places.
Other methods in Extension enable developers to make queries about interactive depictables. Lines 21 and 22 show a method that returns the entire sequence of interactive depictables, ordered by frame index. Line 7's method tells the index of the currently displayed interactive depictable. And line 23 allows an extension equipped with a time index to get the corresponding interactive depictable. Using these methods, an extension can read and modify the editable elements that reside in the interactive depictables.
To demonstrate how one might use the framework, shown below is an example of a small extension that creates points at different locations in every frame, with an annotation that shows that latitude/longitude of the point. The forecaster can move the point in any frame---and the annotation will change to show the new latitude and longitude.
class SampleExtension : public Extension {
public:
SampleExtension( omitted ) : Extension ( omitted ) {}
virtual void handleIntDepictSeqChanged(
SeqOfPtr< InteractiveDepictExt* >,
SeqOfPtr< InteractiveDepictExt* >,
SeqOfPtr< InteractiveDepictExt* > newDepicts
) {
char buf[20]; // Space to hold annotation
for (int i = 0; i < newDepicts.length(); ++i) {
// Put a point in each frame.
LatLonCoord coord(40 + (i * 3), -100 - (i * 3));
sprintf(buf, "Point at %f,%f", coord.lat,
coord.lon); // Make the annotation
// Create the point and add it to depictable
newDepicts[i]->newElement(new
EditablePoint(coord,
Marker(Marker::X_ICON), buf));
}
}
virtual void editedPoint(EditablePoint* pt, bool) {
char buf[20]; // Space for new annotation
// Get new location
LatLonCoord newCoord(pt->location());
sprintf(buf, "Point at %f,%f", newCoord.lat,
newCoord.lon); // Make new annotation
pt->setAnnotation(buf); // Update annotation
interactiveDepictables()[activeIntDepictIndex()]
->newElement(pt); // Update point in frame
}
};
FSL has implemented the following extensions (and others not listed) that are shipped as part of the D2D software:
- WarnGen, the most complex extension, generates severe weather warning text. It includes storm tracking and warning area features. The forecaster draws a polygon representing a warning area, and the affected counties are marked. The storm tracker plots the current and predicted path of a storm. From this information, WarnGen automatically creates a text product listing the storm's movement, affected counties or zones, and other (optional) text.
- Distance/Bearing displays several editable lines. The forecaster moves the lines between on-screen objects, and the annotation on the lines shows the distance and compass bearing between them.
- Points and Baselines are two helper extensions. When requesting vertical or cross-section data from D2D, the forecaster uses these extensions to locate a point or a baseline from which to compute the displayed data.
The D2D extension framework is like other frameworks in that it provides an architecture for a specific problem domain, similar to the ASX framework for distributed systems (Schmidt and Sudo, 1994) or the Conduits+ framework for network protocols (Hüni et al., 1995).
The ASX framework features many classes from which a developer derives classes to implement application-specific behavior, whereas the extension framework uses just one class (class Extension). This is because the D2D extensions are far more limited than distributed systems. In addition, many details, such as reading local datasets, are left to the discretion of the local extension developer. The Conduits+ framework is particularly easy to use because of black-box reuse, a kind of software reuse that relies on composition of objects instead of inheritance from base classes. Inheritance frameworks, such as the D2D extension framework, are instances of white-box reuse: developers tend to need to know about the implementation of the components they are reusing.
A framework allows developers to build extensions faster. Families of extensions are all similar, simplifying software maintenance. However, the choice to use a framework for local extensions is risky because the single architecture imposed by it must work for all possible scenarios. Further, frameworks are hard to design, and, because local extensions depend on the framework, the framework's evolution will affect existing extensions (Gamma et al., 1995).
An alternative is to provide a library toolkit, so that extension developers can use any design they wish, and be able to access any part of the library as needed. However, creating local extensions becomes more difficult because the developers now have to make architectural decisions that a framework would have imposed.
FSL implemented another approach for local functionality, the D2D application interface, which is also described in this volume (Kelly, 1997). It enables programs to send commands to the D2D software and receive responses, but does not provide integrated extensions as the D2D extension framework does.
Based on the ease with which FSL developers have created extensions, the extension framework clearly achieves its goal of allowing developers to add capabilities to the D2D workstation with minimal effort. It takes just a few lines of code to put together a complete extension.
Future work for the extension framework will likely include a Tcl interface (Ousterhout, 1994), enabling developers to write simple scripts to make extensions instead of having to compile C++ programs. These scripts may include Tcl's user-interface library, Tk.
Other work may include running extension processes on an application server (Grote and Kahn, 1996) instead of on the same host as the D2D display processes. This will help prevent overtaxing the workstations running the core D2D software and improve system responsiveness.
Thanks to Joseph Wakefield for comments on a draft of this paper, and to Nita Fullerton for invaluable editing services. Thanks also to the other developers at FSL for helping to create the D2D extension framework.
Gamma, E., R. Helm, R. Johnson, and J. Vlissides, 1995: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley.
Grote, U.H., and R.J. Kahn, 1996: Using RISC-Based Architecture and Distributed Network Design in the Development of the WFO-Advanced Workstation. Preprints, Twelfth International Conference on Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, Atlanta, Amer. Meteor. Soc., 202-206.
Hüni, H., R. Johnson, and R. Engel, 1995: A Framework for Network Protocol Software. Preprints, Tenth Conference on Object-Oriented Programming Systems, Languages, and Applications, Austin, 358-369.
Kelly, S., 1997: The Application Interface for the WFO-Advanced Forecaster Workstation, D2D. Preprints, Thirteenth International Conference on Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, Long Beach, Amer. Meteor. Soc., 328-331.
MacDonald, A.E., and J.S. Wakefield, 1996: WFO-Advanced: An AWIPS-like Prototype Forecaster Workstation. Preprints, Twelfth International Conference on Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, Atlanta, Amer. Meteor. Soc., 190-193.
Meszaros, G., 1995: Pattern: Half Object+Protocol. Pattern Languages of Program Design, J. Coplien and D. Schmidt, eds. Addison-Wesley.
Ousterhout, J., 1994: Tcl and the Tk Toolkit. Addison-Wesley.
Schmidt, D., and T. Suda, 1994: An Object-Oriented Framework for Dynamically Configuring Extensible Distributed Systems. Distributed Systems Engineering Journal 2, 280-293.
Footnotes
- *
- Joint collaboration with the Cooperative I
nstitute for Research in the Atmosphere, Colorado State University, Fort Collin
s, Colorado 80523.
Corresponding author address: Sean Kelly, NOAA/ERL/
FSL/SDD R/E/FS4, 325 Broadway, Boulder, CO 80303 [no longer at FSL].
This document is maintained by Joe
Wakefield.
Last updated 3 Oct 97