Defining Your Own Classes

In Jade, every class must be defined as the subclass of some other class (its superclass). To define a new class, you must therefore first select an appropriate superclass (which may be the Object system class if there are no more-suitable candidates) and then define your new class as a subclass of your selected class.

A subclass inherits the behavior of its superclasses. For details about controlling how classes, methods, and properties implemented in your schemas are used by developers in other schemas, see "Controlling the Use of Elements in Other Schemas", in Chapter 1.

If you want to utilize the Transaction Agent Framework (TAF) used in the Erewhon demonstration schemas, you should load the framework classes before you add any of your own classes. This will allow you to add your own classes under the relevant TAF classes, to make it easier to implement that framework in your system. For details, see "Loading the Transaction Agent Framework (TAF) Partial Extract Schemas", elsewhere in this chapter.

To add a class

  1. In the Class Browser window, select the class that you intend to be the superclass of your new class. For details, see "Defining a Class", in the following subsection.

  2. Select the Add command from the Classes menu.

The Define Class dialog, shown in the following image, is then displayed.

The Define Class dialog also contains the following sheets.

The Membership sheet is enabled only if you are adding a subclass to a Collection class or subclass.

The Keys and Tuning sheets are enabled only if you are adding a subclass to a collection Dictionary class, the Options sheet is enabled only if you are adding a subclass to a Control class, and the Web Services sheet is enabled only when you subclass the JadeWebService class or one of its subclasses. The Text, Lifetime, and Volatility sheets are always enabled.