Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
If required, you can extend the SimpleOne data model by adding new 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 unwantedundesirable, use the following data model extension methods:
- InheritanceRecord extended model
- 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, etcand others.
An example of Примером такой таблицы является каталог запросов: он состоит из родительской таблицы для каталога и записей в таблице для каждого шаблона запроса с определенными атрибутами.
Расширенная модель записи
При использовании расширенной модели записи (REM) не создаются новые таблицы и колонки, а создаются атрибуты данных, выборочно применяемые к определенным записям таблицы. При применении расширенной модели к той или иной записи, для нее создается вспомогательный набор записей, в котором хранится информация по значениям конкретных атрибутов. Таким образом у записи есть атрибуты, полученные от таблицы и, дополнительно, атрибуты, получаемые из расширенной модели (REM-атрибуты).
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Благодаря REM-атрибутам можно обойти ограничения механизма наследования, добавляя к записям атрибуты, которые не будут наследоваться дочерними таблицами. Без REM атрибутов пришлось бы создавать большое количество уровней наследования, на которых родитель отличается от потомка наличием всего одного поля. Кроме того, REM-атрибуты могут объединяться в REM-модели, позволяющие осуществлять категоризацию объектов из одной таблицы. Примером такого использования является каталог услуг.
Table of Contents |
---|