next up previous contents index
Next: 11.3 Utility Functions Up: 11. Envelope Viewing Application Previous: 11.1 Usage

  
11.2 Architecture

This section will briefly explain the internal structure of the envelope viewing application VIEWENV to allow for easier extension or modification.

Note that the term derived has already been used in section 2 in the sense of computationally derived. In this section, as in object-oriented programming in general, it is used in both this sense and in the sense of derived by inheritance in descriptions of relations between classes.


  
Figure 3.1: Optimal class design for VIEWENV.
\begin{figure}\centerline{\epsfbox{pics/ve-optimal.eps}} \end{figure}

The intended object-oriented class hierarchy is shown in figure 3.1. The different tasks of a curve (something to be displayed) and a file (loaded data) are separated, since some curves don't own their proper data, but are derived from data loaded in a different class. This type of derivation is expressed as a usage relation, e.g. between Discrete Cepstrum and Format. Those classes who directly display the loaded data use multiple inheritance from Curve and File, e.g. Envelope.

Unfortunately, the realization of the principles of object-oriented programming is far from perfect in the MATLAB programming language. Indeed, it is quite cumbersome to write classes, e.g. the inheritance has to be ``hand made'' and a separate directory is needed for each class, with a separate source file for each method. Thus, for reasons of feasibility, the class design had to be stripped down to the one shown in figure 3.2.


  
Figure 3.2: Feasible class design for VIEWENV.
\begin{figure}\centerline{\epsfbox{pics/ve-feasible.eps}} \end{figure}

The new basic class Curve is a fusion of the curve and file functionalites, although some of them will not be used by certain derived classes. The Curve class handles all commonalities of the different derived classes, such as the callbacks from the file handling buttons of the user interface.

To define a new class derived from Curve, all that has to be done is to write a constructor which calls the Curve constructor, provide a load.m method, a paint.m method, and possibly a callback.m method, to handle user interface elements to input parameter values.


next up previous contents index
Next: 11.3 Utility Functions Up: 11. Envelope Viewing Application Previous: 11.1 Usage
Diemo Schwarz
1998-09-07