Application Framework Classes

The application framework classes provide the system-specific structure for the application. In an MFC application these classes include the application (

CPhishApp
) as well as the document/view architecture classes.

The job of the framework classes is to encapsulate the framework-specific requirements and also to provide an interface to the services provided by the application framework. When the application is ported to a different environment, these will be the only classes that change.

In the case of Phish, we implemented a dialog-based window for the primary view (

CPhishDlg
). There are additional dialogs, including a property page for managing the various species (
CSpeciesManagerPage
). In addition, there are classes to represent the device context, the display window, as well as icons and images.

To provide for cross-platform portability, many of the platform-specific classes are concrete implementations of platform-independent abstract base classes. For example,

CDevice
,
CDisplay
,
CImage
are derived from
PADevice
,
PADisplay
and
PAImage
.

Utility Classes

The principal utility classes provide logging and debugging assistance. These include

Function
,
FunctionTimer
and
DebugStream
. There are also utility classes for memory management, including
RCBody
and
RCHandle
.

Model Classes

The remaining classes are the business objects, also known as model classes. These include

PAnimal
,
PLocation
and
PSpecies
, as well as those classes representing the Phish tank (
PPhishTank
) and the simulator (
PSimulator
). Also included in this category are the classes that encapsulate policy and rules, such as
PResolver
.

© 1998 by Wrox Press. All rights reserved.