| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 18)

System-Defined Classes

The preceding overview emphasized the use of items and classes to represent knowledge. However, G2's object system is completely general. G2 uses it to provide all KB components: workspaces, procedures, rules, message boards, charts, buttons, meters, and many other things are all items.

G2 contains a hierarchy of system-defined classes that provides all of the classes G2 needs to construct a KB, plus additional classes that you can use to represent knowledge. System-defined classes are inherent in G2. They do not appear as icons on workspaces, and you cannot access, inspect, modify, or delete them.

The root class of the system-defined class hierarchy is called ITEM. This class provides several attributes for all classes, as described in Chapter 10, G2 Items and Chapter 14, Definitions.

Varieties of System-Defined Classes

System-defined classes have various properties that control how you can use them. These properties determine whether a class can be instantiated, and whether and in what ways it can be inherited by a subclass.

If you know the purpose of a class, you will rarely attempt to use it incorrectly, because the incorrect use would make little sense. Therefore, you don't need to memorize which system-defined classes have which properties. If you do try to use a class incorrectly, the Text Editor will catch and describe the error.

G2 uses various terms to categorize system-defined classes according to their properties. The essential terms are:

Terms exist to denote combinations of extensibility, instantiability, and purpose:

Instantiating System-Defined Classes

You can instantiate system-defined classes in two ways:

You can also use create to instantiate user-defined classes, as described in the next section. For information on the create action, see Chapter 19, Actions.

Instances of some system-defined classes can appear as icons on workspaces. The icon characteristic of each such class is predefined for the class, and cannot be changed.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 18)

Copyright © 1997 Gensym Corporation, Inc.