company logo

reference collection

A reference collection is a collection, which not directly stores its instances, but which stores pointers to its instances. Reference collections are the base for sharing instances, i.e. for referring to instances from different places.

Usually, reference collections support any number of indexes (sort orders) for the collection.

When the reference collection is not owner of instances, in general, different persistence types are allowed for instances belonging to the collection instance (not owning). In order to simplify the handling of different persistence types, ODABA supports only instances with the same persistence type (persistent, temporary or transient) in a reference collection. The persistence type for instances in a reference collection is part of the property definition.

In principal, bounded or permanent persistent state could be detected at run-time. Since bounded reference collections usually require different handling than permanent reference collections, bounded or permanent persistence state must also be defined for the reference collection.

Since there is no persistence type defined for data types, the usage of permanent temporary or permanent transient reference collections may lead to conflicts within an application. Instances with those data types can never be stored as persistent instances. In order to be a bit more flexible, ODABA allows this, but permanent temporary/transient reference collections become inaccessible within persistent instances.

Generalisations:  collection instance

Related topics