Implementing a Class Hierarchy
Techniques for implementing a class hierarchy appear in Chapter 13, Classes and Class Hierarchy, and Chapter 14, Definitions. This chapter does not repeat the information available there.
You do not have to define the classes for which you need methods before you define the methods themselves: you can implement classes, method definitions, and methods in any order. When you create methods before creating their class, all of the methods become usable as soon as you create the class.
However, you may find it convenient to define classes before defining the methods that use them, because a method defined for a nonexistent class contains a warning in its Notes attribute that the class it applies to does not exist. Such warnings can become tiresome.
Class hierarchies rarely provide the ideal structure when first implemented, and methods rarely provide the ideal hierarchy of behavior from their inception. As you develop your KB, you can iteratively develop and refine your class hierarchy and its associated methods, changing each as needed to reflect changes in the other. G2 immediately updates existing classes and methods as needed to reflect any such changes.
Copyright © 1997 Gensym Corporation, Inc.