3.3 Remapping Operations
3.3.2 Remapping in the Solution Space
Besides the feature remapping operators for the problem space, it is also possible to perform a remapping from a solution space perspective. In this case, the respective modifications are called object remapping operators. There are two elementary differences between feature and object remapping operators. For one, a feature remapping operator mostly changes a mapping’s feature expression. In contrast, object remapping operators affect the solution space end of a mapping, which means that they modify the target of the reference to a realization artifact. The only exception is Remove Object Mapping, which merely deletes a mapping. The second difference of remapping operators for the problem and solution space is that individual mappings are copied differently. In the problem space, mappings have to be copied logically as no two mappings of the same type may exist that point to the same solution space asset. This same constraint still holds for the solution space. However, if a given target object has no previously existing mapping, a physical copy of a mapping for the new target may be created. The details of this procedure will be explained in the following sections.
In sum, three different remapping operators for the solution space are provided that move, copy and remove mappings of a given realization artifact. With these operators, it is possible to adequately remap the evolutions presented in Section 3.1.2. Furthermore, the operators have proven to be sufficient to compensate for the changes performed by the evolutions of Refactory (see Section 4.1.1), which is used as basis for the implementation of the evolution system. Thus, equivalents to the operators that split and merge mappings of the problem space have not been conceptualized. Instead, the following sections will focus on the operators to move, copy and remove an object mapping.
3.3.2.1 Move Object Mapping
The Move Object Mapping operator relocates the mappings of a specified solution space artifact to an arbitrary number of targets. Logically, the mappings are moved from the source to all targets. Physically, the original mapping is first copied n times for all target objects. Then, the solution space end of the copied mappings is replaced to point to the respective target object in the second step. Finally, the original mapping is deleted from the mapping model. Optionally, it is possible for users to select effective targets from the list of all potential targets for each individual affected mapping. For example, a mapping could be copied to only two of the three potential target objects if the creator of the remapping permitted it.
Special care is to be applied if a mapping is copied to a target that already participates in another mapping. In this case, the original mapping can not be duplicated physically because
then there would be two mappings of the same type pointing to the same solution space element but with potentially different feature expressions. This situation is explicitly prohibited by FeatureMapper. Thus, the mapping has to be copied logically much like in the problem space. This means, that the feature expressions of the original and the already existing mapping for the target have to be concatenated using the OR operator and then be used as term for the mapping. This way, satisfying at least one of the partial feature expressions leads to the solution space element being included in a variant, which is the same effect as creating a physical copy. In Table 3.7, an example of applying Move Object Mapping with two targets is shown where one of the elements participates in a mapping and the other one does not.
Table 3.7: Example of Move Object Mapping.
a) original mapping
FeatureA AND FeatureB UML:Class[ElementA] FeatureC UML:Class[ElementC]
b) after Move Object Mapping (Move: ElementA → ElementB, ElementC) FeatureA AND FeatureB UML:Class[ElementB]
(FeatureA AND FeatureB) OR FeatureC UML:Class[ElementC]
3.3.2.2 Copy Object Mapping
The Copy Object Mapping operator duplicates the mapping of a specified solution space element for an arbitrary number of target objects. Its inner structure is largely equivalent to the Move Object Mapping operator presented in the previous section. However, copying a mapping does not delete the mapping of the original element from the mapping model. To perform the Copy Object Mapping operation, the mapping of the source object is first duplicated n times for all targets. After that, the value of the solution space end of the mapping is substituted with the respective target object. Unlike in the problem space, remapping in the solution space allows to create physical copies of mappings. This means, that the entire entry of a mapping can be cloned. However, Copy Object Mapping has to face the same situation as Move Object Mapping if the target of a copy operation already participates in another mapping. In this case, cloning the original mapping physically and redirecting it to the new target would violate the constraint that there may be only one mapping of each type for a given solution space element. This situation is resolved through creating a logical copy of a mapping by using the same means as in the problem space. In detail, this means that the feature expression of both the original and the already existing mapping for the target have to be connected using the OR operator. A physical copy is not created in this case but the existing mapping has its feature expression modified instead. This procedure constitutes the copy operation for mappings to different solution space assets. In Table 3.8, an example of Copy Object Mapping is presented, which covers the two cases where a target object participates in another mapping and where it does not.
Table 3.8: Example of Copy Object Mapping.
a) original mapping
FeatureA AND FeatureB UML:Class[ElementA] FeatureC UML:Class[ElementC]
b) after Copy Object Mapping (Copy: ElementA → ElementB, ElementC) FeatureA AND FeatureB UML:Class[ElementA]
FeatureA AND FeatureB UML:Class[ElementB] (FeatureA AND FeatureB) OR FeatureC UML:Class[ElementC]
3.3.2.3 Remove Object Mapping
The Remove Object Mapping operator deletes the mapping of an arbitrary number of source elements of the solution space. When compared with the equivalent operation for the problem space, the Remove Object Mapping operation is rather straightforward. In the problem space, the feature expression of a mapping has to be modified by removing all references to the features that have their mapping deleted. In contrast, in the solution space, it is possible to simply delete a given entry of the mapping model to remove the mapping from its solution space element. This is due to the fact that each mapping has exactly one realization artifact as solution space end. Thus, if the element is removed, the mapping would point to a null value, which is prohibited by convention. Therefore, the mapping has to be deleted whenever its respective solution space element has its mapping removed. A demonstration of this procedure can be seen in Table 3.9.
Table 3.9: Example of Remove Object Mapping.
a) original mapping
FeatureA UML:Class[ElementA] FeatureA OR FeatureB OR FeatureC UML:Class[ElementA] NOT FeatureA AND FeatureB UML:Class[ElementA]
b) after Remove Object Mapping (Remove: ElementA) - (mapping removed) - (mapping removed) - (mapping removed) - (mapping removed) - (mapping removed) - (mapping removed)