Class Component Selector
A static component
comp of a class can be accessed using the name
In this case, no instance of the class needs to be created. The characters
are the class component selector. The name
class of a class must be to the
left of the class component selector. The name
comp of the component must be to the right of the class component selector.
The class component selector can also be used to access the data types and constants of an interface.
intf of an interface must be to the left of the class component
sector. The name
type of a data type defined using
or the name
const of a constant defined using
CONSTANTS must be to the right of the object component selector.
7.31 | 7.40 | 7.54
It is also possible to access the static components of a class using the object component selector if an instance of the class was created.
Declares a class
factory and accesses its static attribute
CLASS factory DEFINITION CREATE PRIVATE. PUBLIC SECTION. CLASS-DATA oref TYPE REF TO factory. CLASS-METHODS class_constructor. METHODS do_something. ENDCLASS. ... factory=>oref->do_something( ). ... CLASS factory IMPLEMENTATION. METHOD class_constructor. CREATE OBJECT oref. ENDMETHOD. METHOD do_something. ... ENDMETHOD. ENDCLASS.