SGML/XML has the power to define very complex data models. The major reason for this is the fact that it represents a tree structure which is one of the most intuitive data models for the real world. I am using the term "object oriented" rather in the sense that the data model is oriented towards the structure of the described objects than in the traditional sense of object oriented programming.
| | The tree structure reflects the "one to one" as well as the "one to many" relationships of the relational database. But it goes far beyond this because this structure can be nested infinitely and some control of the cardinality is there.
|
There is no need for normalization, since SGML/XML can very well handle denormalized data in its tree structure.
| | Data objects are grouped in containers. This expresses most of the relationships directly and avoids the introduction of artificial access keys or links.
|
| | 5.1. Natural addressing in MSR 4.3.1. Supporting the entire life cycle If there are "many to many" relationships, those can be established using existing data (natural keys). Any data can be used to establish links within an instance (see also ). These links have a very specific semantic (link types) which can be derived from the position of the anchor, the anchor element itself or be determined by architecture attributes. This approach for linking is based on the natural object hierarchy (also establishing a hierarchy of namespaces) and not on the element hierarchy in the instance. Therefore the resulting methods usually are not directly compatible with the linking methods provided by SGML/XML such as ID/IDREF, HyTime or XLL. To use SGML/XML methods for linking, a transformation step is required (see also ).
|
| | The DTD provides a data model with implicit access paths to data. This allows to use very flexible navigation approaches and query languages.
|
| | The occurrence operator allows various instances matching one DTD. This can be used for subclassing. Subclassing can be controlled by other elements (e.g. sw-param-class in ) or by attributes (Architectural Forms).
|
| | Object orientation (in the sense of object oriented programming) can be implemented using SGML/XML by defining the appropriate semantics for the elements. This covers the inheritance of data contents (not of data structures) as well as the option to keep certain methods as queries in elements (although there is no established standard for this).
|
As one example for an object oriented model is given in the following figure (). It comes from MSRSW.DTD which is used in the development of software for an engine control system. The DTD is the data scheme for calibration parameters in the ECU . Such a parameter can be a single value, a curve or even a map. This is reflected in the DTD by some alternative branches used to support alternative details. For example, a single value only has a value axis but no x or y axis. A curve has a value axis, an x axis but no y axis. The map however has three axis (value, x and y). sw-param-class denotes the class of the parameter and determines which alternatives must be used. This illustrates, how subclassing can be performed using object oriented DTDs .
Example of an object oriented DTD
Figure 5:
The following illustrates, how this structure is filled in the instance. It is one of the characteristics to calibrate an engine management system. The example (related to the one in ) is a curve with individual set points.
Instance for calibration parameter
sw-param long-nameLambda Wirkungsgrad/long-name short-nameetalam/short-name sw-param-classcurve_individual/sw-param-class desc Abbildung Basis-Lambda auf den Lambda-Wirkungsgrad ohne Eingriff bezogen auf optimales Moment bei Lambda=1 /desc sw-param-array-x sw-param-axis-x sw-axis-individual sw-variable-reflambas/sw-variable-ref max-count10/max-count /sw-axis-individual /sw-param-axis-x sw-param-axis-values sw-compu-method-refrel_ub_b127b5/sw-compu-method-ref /sw-param-axis-values sw-addressing-method-refNearRomByte/sw-addressing-method-ref sw-param-record-layout-refKlAUbSstUbWUb/sw-param-record-layout-ref sw-code-syntax-refKlNearAUbSstUbUb/sw-code-syntax-ref /sw-param
|