Use the DEF CLASS directive in Object Oriented Programming
(OOP) to declare the start of an object definition. It defines the
name of the object and it can be used to override object creation
and deletion logic.
class$ specifies the class name that will refer to
this type of object. Class names are case-insensitive and
forward/backward slashes are considered equivalent. Duplicate names
are not allowed within the system. An object declared as UNIQUE will
have a single instance created, and any subsequent attempt to create
an instance returns the same object identifier and increments the
object reference count by one.
By default, an object can have ON_CREATE and/or ON_DELETE
logic defined. You can override this by specifying new label names
for the creation/deletion logic via CREATE label and DELETE label
clauses in the class definition. Normally, object creation/deletion
logic is invoked when an object of this specific class is
created/destroyed. That means, if you have ON_CREATE logic for an
object A and object B inherits it, then the ON_CREATE for object A
will not be executed on creation of object B. You can force creation
and/or deletion logic to be executed on inheritance by including the
keyword REQUIRED.
In terms of precedence, if an object inherits another object
that has creation logic, the creation logic for the inherited object
is performed first; e.g., if object C inherited object B which
inherited object A, then the ON_CREATE in object A would be
performed first, followed by object B's and finally object C's.
(Deletion logic is performed in the opposite order).
|