company logo

Virtual collection or reference

Keywords:  persistence type

Virtual collection are used for accessing views. Virtual collections provide fast access to the first instance in a view, but it becomes very inefficient for random view access. Usually, virtual collections are used during a short period of the process to browse to a view result sequentially.

Virtual collections or references are also used for providing short cuts to far properties (grand_fathers_name: father(0).father(0).name).

Virtual collections are references being defined as property (reference) of an instance (structure) or globally as extent. For defining a virtual collection, the transient option must be switched on and a source must be defined for the reference or the reference must refer to a static view definition in the type. Virtual collections must not have index definitions and the created option must be switched off.

Usually, virtual collections are transient (bounded) properties, i.e. they are evaluated each time after selecting an instance having virtual collections. In order to avoid re-calculation for virtual properties, thous may marked as permanent transient (persistence type).

When defining a virtual collection as instance property, the collection changes from instance to instance.

Virtual collections are not filled but calculate instances on demand. Virtual collections can be access by position, only. When opening a virtual collection, only the calculation rule is set up.