The principle of inheritance is to mutualize resources that are shared by multiple contexts or entities. TIBCO EBX® offers mechanisms for defining, factorizing and resolving data values: dataset inheritance and inherited fields.
Dataset inheritance is particularly useful when data applies to global enterprise contexts, such as subsidiaries or business partners.
Based on a hierarchy of datasets, it is possible to factorize common data into the root or intermediate datasets and define specialized data in specific contexts.
The dataset inheritance mechanisms are detailed below in Dataset inheritance.
Contrary to dataset inheritance, which exploits global built-in relationships between datasets, inherited fields exploit finer-grained dependencies that are specific to the data structure. It allows factorizing and specializing data at the business entities-level.
For example, if the model specifies that a 'Product' is associated with a 'FamilyOfProducts', it is possible that some attributes of 'Product' inherit their values from the attributes defined in its associated 'FamilyOfProducts'.
When using both inheritance in the same dataset, field inheritance has priority over the dataset one.
The dataset inheritance lookup mechanism for values proceeds as follows:
If the value is locally defined, it is returned.
Otherwise, looks up the first locally defined value according to the built-in child-to-parent relationship of the dataset in the hierarchy of datasets.
If no locally defined value is found, the default value is returned.
If no default value is defined, null
is returned.
Note: Default values cannot be defined on:
A single primary key node
Auto-incremented nodes
Nodes defining a computed value
Like values, table records can also be inherited as a unit by multiple contexts, but they can also be partially redefined (overwritten), defined for a specific context (root mode), or be occulted.
Formally, a table record has one of four distinct definition modes:
root record | Locally defined in the table and has no parent. This means that no record with the same primary key exists in the parent table, or that this parent is an occulting record. |
overwriting record | Locally defined in the table and has a parent record. This means that a record with the same primary key exists in the parent table, and that this parent is not an occulting record. The overwriting record inherits its values from its parent, except for the values that it explicitly redefines. |
inherited record | Not locally defined in the current table and has a parent record. All values are inherited. |
occulting record | Specifies that, if a parent with the same primary key is defined, this parent will not be visible in table descendants. |
It is also possible to specify management rules in the declaration of a table in the data model.
The specific inheritance mechanism allows fetching a value of a field according to its relationship to other tables.
The lookup mechanism for inherited fields values proceeds as follows:
If the value is locally defined, it is returned.
Otherwise, looks up the source record and value to inherit from, according to the properties that are defined in the data model.
The process is recursive; if the source node does not locally define a value, it is then looked up according to the inheritance behavior of the source node.
EBX® provides a built-in user service for optimizing the dataset inheritance in the hierarchy of datasets. This service performs the following functions:
Handles duplicated values: Detects and removes all parameter values that are duplicates of the inherited value.
Mutualizes common values: Detects and mutualizes the common values among the descendants of a common ancestor.
Datasets are processed from the bottom up, which means that if the service is run on the dataset at level N, with N+1 being the level of its children and N+2 being the level of its children's children, the service will first process the datasets at level N+2 to determine if they can be optimized with respect to the datasets at level N+1. Next, it would proceed with an optimization of level N+1 against level N.
These optimization and refactoring functions do not handle default values that are declared in the data model.
The highest level considered during the optimization procedure is always the dataset on which the service is run. This means that optimization and refactoring are not performed between the target dataset and its own ancestors.
Table optimization is performed on records with the same primary key.
Inherited fields are not optimized.
The optimization and refactoring functions do not modify the resolved view of a dataset, if it is activated.
The 'Optimize & Refactor' service is available on datasets that have child datasets and have the 'Activated' property set to 'No' in their dataset information.
The service is available to any profile with write access on current dataset values. It can be disabled by setting restrictive access rights on a profile.
For performance reasons, access rights are not verified on every node and table record.