Defining and Compiling JADE Methods and Conditions

You can define a JADE user-defined method or condition at any time. When you have defined a JADE method or condition, it can be invoked for any instance of the class or primitive type in which it is defined for any instance of a subclass of that class.

Object methods are always defined for a class. Object methods are generally called from other methods, with the exception of a group of methods referred to as event methods. An event method can also be called by the runtime JADE system in response to a window event.

For details about:

Conditions are declarative restricted methods that return a Boolean result. Constraints are conditions used to maintain automatic inverse references when the specified conditions are satisfied. For details, see "Adding Conditions to Classes or Primitive Types", later in this chapter.

A condition that is used as a constraint cannot have parameters nor can it use array indexing ([<index>]) and dictionary indexing ([<key, key, ...>]). You cannot reimplement a condition inherited from a superschema or superclass. In addition, a condition cannot use array indexing ([index]) or dictionary indexing ([key, key, ...]).

Only automatic references can have a constraint. When the manual side of the inverse reference is set, the condition used as the constraint is evaluated and the automatic inverse is set only if the value of the condition is true. If the automatic reference is a Collection type, the condition is applied to the members of the collection.

You cannot add a method to the current version of a class if that method was added to the latest version of any superclass or subclass, including those on superschemas and subschemas.

The JADE development environment enables you to move classes and copy or move methods by dragging them to the required class or primitive type. To do this:

  1. Select the class or method and then press the:

    • Ctrl or Shift key to move a class

    • Ctrl key to copy a method

    • Shift key to move a method

    You can drag a key from an external key dictionary only if there are no items in that dictionary.

  2. Drag the class to the class of which it is to be a subclass or the method to the class or primitive type to which you want to copy or move it.

  3. Release the button. If the copy or move action is valid, a message box then prompts you to confirm that you want to move the class to the required class or method to the required class or primitive type.

  4. Click the Yes button to complete the move action.