Programming Guide : Working with Classes : Inheritance : User Class Hierarchies
 
Share this page          
User Class Hierarchies
You can organize your user classes into an inheritance hierarchy similar to the hierarchy of the OpenROAD system classes. The Employee superclass with PermanentEmployee and TempEmployee subclasses is one such example.
You can specify a user class as the superclass of another user class; otherwise the superclass is automatically defined as UserObject. If you specify another user class as the superclass, it must be defined in the current application or any of its included applications.
Although you cannot create subclasses of a system class by specifying the system class as the superclass of a user class, you can use field templates and frame style sheets to simulate a child of a system class. For example, if you want different types of ButtonField objects to have certain behaviors or visual characteristics, you can add new button fields to a frame template, setting the attributes to your specifications and attaching a script that promotes certain behaviors.
For example, if you always want a Clear button to look and act in a certain way, you can create a field template that contains this button. Fields that are built from the field template would all use this version of the Clear button.