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.

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.