A ClassDefinition object is a PowerBuilder object that provides information about the class of another PowerBuilder object. You can examine a class in a PowerBuilder library or the class of an instantiated object. By examining the properties of its ClassDefinition object, you can get details about how a class fits in the PowerBuilder object hierarchy.
From the ClassDefinition object, you can discover:
The variables, functions, and events defined for the class
The class’s ancestor
The class’s parent
The class’s children (nested classes)
Related objects The ClassDefinition object is a member of a hierarchy of objects, including the TypeDefinition, VariableDefinition, and ScriptDefinition objects, that provide information about datatypes or about the variables, properties, functions, and event scripts associated with a class definition.
For more information, see the Browser or Objects and Controls.
Definitions for instantiated objects For each object instance, a ClassDefinition property makes available a ClassDefinition object to describe its definition. The ClassDefinition object does not provide information about the object instance, such as the values of its variables. You get that information by addressing the instance directly.
Definitions for objects in libraries An object does not have to be instantiated to get class information. For an object in a PowerBuilder library, you can call the FindClassDefinition function to get its ClassDefinition object.
Performance Class definition objects may seem to add a lot of overhead, but the overhead is incurred only when you refer to the ClassDefinition object. The ClassDefinition object is instantiated only when you call FindClassDefinition or access the ClassDefinition property of a PowerBuilder object. Likewise, for properties of the ClassDefinition object that are themselves ClassDefinition or VariableDefinition objects, the objects are instantiated only when you refer to those properties.