Basic Structures of the Logical Schema

The Commerce Server Data Warehouse uses a logical schema to isolate applications from the underlying physical database. The logical schema defines the conceptual infrastructure of the Data Warehouse. The basic structures of the logical schema are the class, data member, key, and relation.

Class

The class is fundamental to the Data Warehouse logical schema. A class is a logical collection of data members. An instance of a class represents the user data imported into the Data Warehouse.

Data member

A data member stores a piece of data. A class contains an arbitrary number of data members that define the logical scope of the class. New data members may be added at any time after the class is created.

Key

A key is a data member or set of data members that uniquely identifies instances of a class. In the previous example, the key for the OrderFormLineItems class is a combination of the private lineitem_id data member and the inherited OrderForm_Id and OrderGroup_Id data members. This means that instances of an OrderFormLineItems class include a unique identifier for the line item plus unique identifiers for the OrderFormHeader and OrderGroup classes.

Relation

A relation connects two classes in a parent-child association. This relation defines the number of instances of each class. In the Commerce Server 2000 Data Warehouse, nearly all relations are one-to-many. This means that zero or more children may exist for each parent. For example, an individual order form has precisely one instance of the OrderFormHeader class. The order form may have multiple line items represented by multiple instances of the OrderFormLineItems class associated with the single OrderFormHeader class instance.

A relation provides the mechanism for sharing data members between classes. A parent class may have zero or more data members defined as inheritable. An inheritable data member is copied to any child class when the relation is created. Notice that this is a logical inheritance defined by the schema, and not inheritance from a C++ point of view.

For example, the OrderFormLineItems class inherits three data members from its parent class, OrderFormHeader. One of these data members, OrderForm_Id, is used to identify the order form containing the line item.

The ID and key of a parent class are always inherited by the child class. The ID is persisted in the child class, but to save space, the key and any other inherited members are not. The parent class ID stored in the child is used to retrieve the parent class key and the other inherited members.


All rights reserved.