Access via view definitions
A specific subset of operation paths are view paths. A view path is a path, which refers to a predefined view in the database schema. ODABA supports view schemata as well as view collections. A view schema defines a transient structure and the sources for all its properties. Property sources can be defined in a structure context, i.e. they may refer to properties defined in the structure the view schema is based on. A view schema based on a structure is considered as method of the class formed by the structure. Thus, a view schema can apply to any structure instance of the given type. Applying a view schema to a structure instance is possible in an access path or by defining an appropriate property handle.
- Persons().USE('PView')
- In the path above, the view schema PView applies on all person instances of the person collection. In a way, USE replaces the SELECT clause in an OSI query, but predefined views provide more features for evaluating view properties.
- View properties or transient properties can be defined as static or local properties. As local properties, they will be associated with a structure, but they are not considered as structure methods but as (transient) properties of the data type. Since evaluating transient properties is a performance critical issue, ODABA evaluates transient properties only, when trying to access transient property data. The application may, however, call the Execute() function in order to reevaluate the transient property at any time.
- When the parent changes for a local view property, it will be reevaluated automatically after the next instance is selected in the parent property, when data is requested from the transient property.
- In most cases, views are used for reading data. Sometimes, it might, however, be useful to update view properties and write them back to its origin. This is possible only, as long as the view property receives data directly (1:1 relation) from a persistent source property.