To share common feature selections/exclusions between several variants pure::variants supports VDM inheritance. This allows users to define the models for each VDM from which selections are to be inherited. Changes in the inherited model selection will be propagated automatically to all inheriting models. Inheritance is possible across Configuration Spaces and projects.
This kind of inheritance allows for example combination of partial configurations, restricting choices available to users only to the points where the inherited model left decisions explicitly open, or use of variant configurations in other contexts.
The list of models from which to inherit selections is defined on the properties page of the VDM (see Section 7.5.3, “ Inheritance Page ” ). Models from the following locations can be inherited:
from the same Configuration Space
from another Configuration Space or folder of the same project
from another Configuration Space or folder of a referenced project
Both single and multiple inheritance is supported. Single inheritance means that a VDM inherits directly from exactly one VDM. Multiple inheritance means directly inheriting from more than one VDM. It is not supported to directly or indirectly inherit a VDM from itself. But it is allowed to indirectly inherit a VDM more than once (diamond inheritance).
The following selections are inherited from a base VDM:
selections explicitly made by the user
exclusions explicitly made by the use
selections the base VDM has inherited from other VDMs
Additionally attribute values defined in a inherited VDM are inherited if the corresponding selection is inherited. The applicable rules for the inheritance are listed in Section 5.7.1, “Inheritance Rules” .
pure::variants 5 introduces the independent inheritance of attributes values and selections. This allows to inherit attribute values from the base VDM without selecting the element as well as leave attributes unset on a inherited selection, which has to be set by the inherating VDM. The independent inheritance mode is active for all projects created with pure::variant 5 and later. Additionally pure::variants 5 projects inherit constraints defined in a vdm. Older projects have to be converted to version 5 in order to use the independent inheritance (See Section 6.18, “Convert a pure::variants 4 project into a pure::variants 5 project” ).
Inherited selections can not be changed directly. To change an inherited selection, the original selection in the inherited VDM has to be changed. Particularly if a selection is inherited that has a non-fixed attribute and no value is given in the inherited VDM, it is not possible to set a value for this attribute in the inheriting VDM. The value can only be set in the inherited VDM.
If both the inherited and the inheriting VDM are open, changes on the inherited VDM are immediately propagated to the inheriting VDM. This propagation follows the rules described in Section 5.7.1, “Inheritance Rules” .
If the list of inherited VDMs for a VDM is changed, all inheriting VDMs have to be closed before.
The following rules apply to the VDM inheritance:
If a model element is user selected in one inherited VDM it must not be user excluded in another. Otherwise it is an error and the conflicting selection is ignored.
There must be no conflicting values for the same attribute in different VDMs of the inheritance hierarchy. Otherwise it is an error and the conflicting attribute value is ignored.
An inherited VDM has to exist in the current or in any of the referenced projects. Otherwise it is an error and the not existing VDM is ignored.
A VDM must not inherit itself, neither direct nor indirect. Otherwise it is an error.