You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

If required, you can extend the SimpleOne data model by adding columns to existing tables. When doing so it is important to remember that the updated data model will apply to all child tables, since the new columns will be inherited. When it is undesirable, use the following data model extension methods:

  • Inheritance
  • Adding REM attributes

Inheritance


Inheritance (also called table extension) allows to create child data structures which inherit all attributes of the parent structure and supplement them with their own attributes. This allows to avoid big number of duplicate columns and build an hierarchical structure of objects in which each following child element is a narrower subset. The inheritance can be multi-level, i.e. a child table can be a parent table for other tables.

When using inheritance keep in mind that many engines have an option to work within child entities as well. For example, business rules, user roles, client scripts.

The inherited values and logic related to the table can be overridden on the level of a child table.

The inheritance mechanism works well when there is a small number of child tables that have a lot of common attributes between them. However, as the number of child pages increases and the number of common attributes decreases, managing such data structure becomes difficult.

A data model with an extended, complex structure has the following drawbacks:

  • Too much storage space is required to store the records.
  • The scripts are executed slower.
  • It becomes difficult to configure features related to a table, such as data import, form view configuration, and others.

An example of such table is the template service catalog: it consists of a parent table for the catalog and table records for each request template with specific attributes.

Record extended model


When using the record extended model (REM) no new tables or columns are created. Instead, new data attributes are created that are selectively applied to specific table records. When an extended model is applied to a record, a supplementary set of records is created for it, in which the information on the values of the specific attributes is stored. Thus the record has attributes received from the table and attributes received from the record extended model (REM attributes).

The REM attributes allow you to avoid the limitations of the inheritance mechanism by adding record attributes that are not inherited by child tables. Without the REM attributes it would be necessary to create a big number of child tables that add a single column. Besides, the REM attributes can be collected into REM models that allow to categorize objects from the same table. An example of such use case is the REM service catalog.

  • No labels