Loading...
 

Dynamic data fields (slots)

Dynamic data fields

Dynamic data fields (slots) are data members that are dynamically added to an object. This means that the object is extended by data fields that were not provided for in the class definition. While all instances of a class share the same data member, this is generally not the case for slots.

Slots can be created in objects of classes CX_EXPANDABLE and CX_CONTAINER or their derivatives.

The slots known (usable) to the system are read in from the initialisation file CLASSIX.INI or from the database or declared at runtime using the statement SystemObject::DefineSlot. The definition of a slot includes its name and its data type. Slots can also describe relations between objects: In this case the type of the objects to be referenced can be specified (and thus restricted).

Slots can also be seen as a set of variables, provided for later use at runtime.
This variable space can be structured by specifiers. A specifier is simply a name that is used to generate names for new dynamic data fields:
The identifiers slot and specifier are the name of a dynamic data field or a specifier. Then designate

slot
specifier.slot

two different dynamic data fields (but with the same data type). Specifiers can be used to reduce the number of slot definitions (and thus the size of the dictionary).

A specifier can be used in the sense of a template. The term

tmp.slot

is then not yet seen as the final description of the data field. Instruction SetSpecifier assigns another specifier s1 or s2 ... or sn to the identifier tmp. This makes it possible to parameterise InstantView® code sections and also formula objects (see classes CX_FORMULA, CX_CONDITIONED_BAG) in relation to dynamic data fields.

A dynamic data field is automatically added to an object when the statements DrainWindow and Put are called.

As soon as objects with dynamic data fields are stored in a database, the definition of these data fields must not be changed.
By means of a cross-reference of all slots it is possible to determine which data fields occur in which objects.

Instructions