company logo

Instance ownership

ODABA supports instance ownership in a sense, that each instance has exactly one owner, which is an extent or instance property. Thus, attributes, references and exclusive base types are owned by its properties. Instances referenced via relationships are owned by the relationship, when the relationship has been defined as owning relationship. Not owning relationships require a superset, which may be another relationship or an extent. Similar to relationships, extents are either owner of collected instances of must get at least one superset. Even though extents may get more than one superset, set hierarchies in ODABA are always defined in a way, that they result in exactly one topmost superset (root extent), which becomes the owner of the instances collected.

Based on the owner concept, each instance creates a sort of micro-cosmos consisting of all recursively owned instances, which is called owner scope. An instance belonging to an owner scope is called local instance. Instances not belonging to an owner scope are called global instances. Local instances may, again, form an owner scope, which is a sub-scope of its owner instance.

When removing an instance from an owning collection (reference, owning relationship or owning extent), the instance will be deleted completely, i.e. the instance and all local instances belonging to its owner scope will be deleted. Removing an instance from a not owning collection, the instance still remains.

Similar to instances, collections create an owner scope consisting of all instances stored in a collection. Thus, operations applying to instance owner scope often may also apply to collection owner scope. Hence, in general we will refer to owner scope in general.

Creating versions for an owner scope implicitly creates versions for the instances and collections in the owner scope. When the owner scope belongs to a global instance, a new version will be created for the global instance.

Owner scopes defined by extents are automatically upgraded for specific versioning modes, only. When, however, upgrading the version for an extent that is not root extent, the root extent version will be upgraded, too.

Subtopics

  1. PersistenceTypes - Persistence types