company logo

PropertyHandle - Property Handle

Property handle are used to handle persistent or transient data sources . A data source is a collection, object instance or an elementary data item. A data source contains the data for a property of a specific object.

A property handle usually handles a collection of subsequent object instance. In special cases the collection is singular (e.g. the "direction" for a person is exactly one "Address" object instance). In other cases the instance is elementary (as e.g. the given names of a person).

A property handle has a cursor function that allows to select one of the instances in the collection as the "current" instance. Only from the selected instance one may retrieve data by means of subsequent property handles or Get () functions ( GetString (), GetTime (), ...) for elementary data sources.

Generic Property handles

One may define generic property handles using the generic property handle constructor (PI( type )()). This requires that one has to created a C++ header file for the referenced type. In this case one may access elementary data field in the instance directly referring to the generated class members. For references the instance contains corresponding generic property handles that one may reference by class member name as well. In this case one has to create the property handle to be access. This makes programming simpler but in this case one has to recompile the application when changing the database structure. This is not necessary when referring to property handles hierarchies created in the application.

Property handle hierarchies

Property handles form a tree that defines a specific view in an application. When defining this view once the property handles can be used as long as the application follows the defined view. When defining a property handle for AllPersons , which is an extent in the database, one may define subordinated property handles for "name", "children", and "company", which refer to the persons name, its children and the company the person is working for. When selecting another person in the AllPersons property handle the data sources for "name", "children" and "company" will change. This, however, is maintained automatically by the system, i.e. when changing the selection in a parent property handle the data sources for all subordinated property handles are updated automatically and one may access them directly.

Filter and temporary data sources

Usually a property handle shows all the elements that have been added to the data source. One may restrict the number of visible instances by setting a filter ( SetFilter ()) using an expression or a C++ function. One may also create a new data source using the Select() function which creates a temporary data source.

Operations with Property handles

Property handles provide all algebraic and set operations. One may apply most of algebraic operations (as +, -, * etc.) on elementary and collection data sources. In this case e.g. the '-' operator corresponds to the relational Minus() operation. In most cases, however, the types of operands must be comparable. One may compare string data with numeric data but one cannot compare a person collection with a date field.

Set operations are defined on the operations defined in relational algebra (Intersection, Union, Minus, Select) rather that by using SQL like Select statements.

Attributes
Function Groups
Functions