company logo

Defining virtual collections

In order to access a view via a transient reference or extent, virtual collections can be defined. In contrast to transient/temporary collections, virtual collections are not pre calculated, i.e. accessing an instance from the collection just means providing the requested instance. Virtual collections perform better when accessing derived collections partially and sequential. Virtual collections should not be used when accessing the collection randomly.

Virtual collections are defined as references or extents with transient option on and without any index definition. A source definition is required, in order to describe the source for the virtual collection. The source definition refers to an operation path or expression, which defines the source collection. When the target type (data type defined for the reference or extent) is a structure type, it must correspond to the result returned from the source. Source expressions are defined in the scope of the reference, i.e. in order to access properties of the parent instance, the expression must go one level up.

When the target type is a view data type, the view definition contains the mapping rules, that assign each instance from the source to the target view. In this case, one or more sources can be defined, which must correspond by name to the source declarations in the view definition.

Source expressions can be assigned in an ODL script reference definition but also in the ClassEditor application as shown above. Sources in the class editor application may get a name, which does not have any specific meaning in this case, i.e. one may choose any name you want.