Dictionary Structure

All platform dictionaries have similar structure. Number of interfaces is created to view data on any dictionary in the Dimensions assembly. The IDimensionModel interface is a common interface reflecting structure of any dictionary.

Attributes

The basis of any dictionary is the set of attributes. Every dictionary attribute is bound to any source field and further values can be obtained by its attribute. Dictionary contains range of attributes with a particular destination:

One attribute can have several destinations.

The IDimAttributes interface is used to get information on dictionary attributes:

Var
    //…
    MB: IMetabase;
    DimModel: IDimensionModel;
    Attrs: IDimAttributes;
    //…
Begin
    //…
    MB := MetabaseClass.Active;
    DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
    Attrs := DimModel.Attributes;
    //…

Sorting

Sorting can be set by attributes. By default, the Order attribute is added into the sorting list via the wizard on creating table dictionary. The IDimOrders interface is used to get information on collection of attributes used for dictionary sorting:

Var
    //…
    MB: IMetabase;
    DimModel: IDimensionModel;
    Attrs: IDimAttributes;
    Orders: IDimOrders;
    //…
Begin
    //…
    MB := MetabaseClass.Active;
    DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
    Attrs := DimModel.Attributes;
    Orders := Attrs.Orders;
    //…

Structure

Dictionary structure includes blocks and indexes.

Blocks

Key element determining the whole hierarchy of dictionary elements are blocks of dictionary. Blocks collate elements to hierarchy structure by any property. Different dictionaries have different number of blocks of different types. The IDimBlocks interface is used to get information on dictionary blocks:

Var
    //…
    MB: IMetabase;
    DimModel: IDimensionModel;
    Blocks: IDimBlocks;
    //…
Begin
    //…
    MB := MetabaseClass.Active;
    DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
    Blocks := DimModel.Blocks;
    //…

Indexes

If dictionary selection is controlled through the core, dictionary should contain indexes. Indexes are created by attributes, by values of which the selection is formed. The IDimIndexes interface is used to get information on dictionary indexes:

Var
    //…
    MB: IMetabase;
    DimModel: IDimensionModel;
    Indexes: IDimIndexes;
    //…
Begin
    //…
    MB := MetabaseClass.Active;
    DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
    Indexes := DimModel.Indexes;
    //…

Levels

If dictionary is created for cubes, it should contain levels for further setting of data aggregation. The IDimLevels interface is used to get information on dictionary levels:

Var
    //…
    MB: IMetabase;
    DimModel: IDimensionModel;
    Levels: IDimLevels;
    //…
Begin
    //…
    MB := MetabaseClass.Active;
    DimModel := MB.ItemById("DimSource").Bind As IDimensionModel;
    Levels := DimModel.Levels;
    //…

See also:

Introduction