company logo

Opening access handles

Property handles form a hierarchical structure, where each property handle represents a property (attribute or reference) in an instance hierarchy. The top property handle must be opened with a database object handle as parent. Subordinated property handles are opened with a property handle as parent.

Considering a Person object in the sample database, you will find the children property. Since the children property refers to a collection of Person s, again, persons in the children collection may have children, too.

Accessing data is possible via generic or typed property handles. Generic property handles provide more control for database access and are save against database model changes. Typed property handles perform a little bit better than generic ones, but provide less control and require recompilation when changing the database structure. Practically, we do not use typed property handles, since it has turned out, that generic property handles are more stable and provide additional support as update control and data conversion.

void OpenHandleHierarchy ( ObjectSpace &os ) {

  Property     person(os,"Person::Persons",PI_Read);

  Property     children;

  children.open(person,"children");

  Property     grand_children(children,"children");

  

  ...

}

Extents in namespaces

When defining extents within the scope of a class or namespace, extents have to be referenced with the scope name (e.g. Person ::All ).