4. Working with Classes : How You Can Create a User Class
 
Share this page                  
How You Can Create a User Class
You create a user class, define its attributes, and optionally declare and define its methods and superclass in the Class Editor of the OpenROAD Workbench. For instructions to create a user class, see the Workbench User Guide.
When you define attributes, you specify:
The name by which they are referenced
A data type
A default value (optional)
Nullability
A remark describing the attribute
Whether the attribute is private to the class
When you define methods, you specify:
The name by which they are invoked
A data type for the return value (can be nullable)
A remark describing the attribute
Whether the method is private to the class
The data type of an attribute or method can be either a simple data type or a class, including another user class. If a user class is defined as the data type, the user class must exist at the time the attribute or method is created.
You define all of a user class's methods in a single 4GL script that is part of the user class source object. Any operations that can be performed syntactically in the 4GL code of a frame or procedure can be done in the 4GL code of a user class method, including invoking another of the class's methods.
Like many other OpenROAD application components, user classes can be created dynamically.