Delegation Operations
Delegation operations move features along the delegation structure.
Collect Feature over Reference
In the metamodel, a feature is moved opposite to a multi-valued reference. In the model, the values of the feature are aggregated accordingly.
Parameters:
- feature: The feature to be moved
- reference: The reference opposite to which the feature is moved
Constraints:
- The feature must belong to the reference's type
- Both feature and reference must be multi-valued or the reference must be single-valued
Combine Features over References
In the metamodel, a number of features are combined in to a single feature by moving it over references to the same class. In the model, the values of the features are moved accordingly.
Parameters:
- features: The features to be combined
- references: The references over which the features are moved (in the same order)
Constraints:
- There must be an equal number of features and references
- All references must have the same class as type
- Each feature has to belong to its reference's class
Extract Class
In the metamodel, a number of features are extracted to a new class. This new class is accessible from the context class through a new containment reference. In the model, the values of the features are extracted to a new instance accordingly.
Parameters:
- contextClass: The context class from which the features are extracted
- features: The features to be extracted
- ePackage: The package in which the extracted class is created
- className: The name of the extracted class
- referenceName: The name of the new containment reference from context to extracted class
Constraints:
- The features have to belong to the same class
- A classifier with the same name already exists
- A feature with the same name already exists
Extract and Group Attribute
In the metamodel, an attribute is extracted into a new class. This extracted class is contained by an existing container class and referenced from the context class. In the model, an instance of the extracted class is created for each different value of the extracted attribute.
Parameters:
- extractedAttribute: The attribute to be extracted
- contextPackage: The package in which the extracted class is created
- extractedClassName: The name of the extracted class
- referenceName: The reference from the context class to the extracted class
- containerClass: The container class for the extracted class
- containerReferenceName: The name of the containment reference from the container class to the extracted class
Constraints:
- The extracted attribute must be single-valued
Flatten Containment Hierarchy
In the metamodel, a containment hierarchy is flattened. More specifically, the reference to denote the root as well as the reference to denote the children are replaced by a containment reference. In the model, the corresponding hierarchies are flattened accordingly.
Parameters:
- rootReference: The reference to denote the root node
- childrenReference: The reference to denote the children nodes
- referenceName: The reference which replaces the containment hierarchy
Constraints:
- The root reference must be a single-valued containment reference.
- The children reference must be defined by the node class.
- The children reference must be a multi-valued containment reference.
- The type of the children reference must be the node class.
Fold Class
In the metamodel, a number of features are extracted into an existing class. More specifically, a containment reference to the extracted class is created and the features are replaced by features of the extracted class. In the model, the values of the features are moved accordingly to a new instance of the extracted class.
Parameters:
- toReplace: The features to be extracted
- extractedClass: The extracted class
- replaceBy: The features of the extracted class by which they are replaced (in the same order)
- referenceName: The name of the containment reference
Constraints:
- The features must be of the same multiplicity
- The features must be of the same type
- The features to replace must be defined in the extracted class
- The replaced and replacing features must be of the same size
Inline Class
In the metamodel, a class reachable through a single-valued containment reference is inlined. More specifically, its features are moved to the source class of the reference. In the model, the values of these features are moved accordingly.
Parameters:
- reference: The reference to the class to be inlined
Constraints:
- The class to be inlined must not be a type of another reference
- The reference must not have an opposite
- The reference must be containment
- The multiplicity of the reference must be single-valued
- The class to be inlined must not have sub classes
Introduce Composite Pattern
In the metamodel, the composite design pattern is introduced. More specifically, a class is refined by two sub classes - one for composite and one for leaf elements, and a reference is moved to the composite class. In addition, the class is made abstract. In the model, instances of that class are migrated based on whether the reference is populated or not.
Parameters:
- eClass: The class which is refined
- compositeName: The name of the composite class
- leafName: The name of the leaf class
- childReference: The reference for composite elements
Constraints:
- The child reference must be a containment reference
- The child reference must be defined by the class
- The class must not have sub classes
Move Feature along Reference
In the metamodel, a feature is moved along a single-valued reference. In the model, values are moved accordingly.
Parameters:
- feature: The feature to be moved
- reference: The reference along which the feature is moved
Constraints:
- The multiplicity of its opposite reference must be single-valued
- A feature with that name already exists in the target class
- The multiplicity of the reference must be single-valued and obligatory
- The reference must be available in the same class as the feature
Propagate Feature over References
In the metamodel, a feature is propagated opposite to a number of references. More specifically, the feature is created in each of the classes which are sources of the references. In the model, the values of that feature are moved accordingly.
Parameters:
- mainFeature: The feature to be propagated
- references: The references opposite to which the feature is propagated
Constraints:
- Every reference has to target the class with the feature
Unfold Class
In the metamodel, a class reachable through a single-valued containment reference is unfolded. More specifically, its features are copied to the source class of the reference which is deleted. In the model, the values of these features are moved accordingly.
Parameters:
- reference: The reference to the class to be unfolded
Constraints:
- The reference must not have an opposite
- The reference must be containment
- The multiplicity of the reference must be single-valued
- The class to be unfolded must not have sub classes
Contents
- Structural Primitives
- Non-structural Primitives
- Generalization / Specialization Operations
- Inheritance Operations
- Delegation Operations
- Collect Feature over Reference
- Combine Features over References
- Extract Class
- Extract and Group Attribute
- Flatten Containment Hierarchy
- Fold Class
- Inline Class
- Introduce Composite Pattern
- Move Feature along Reference
- Propagate Feature over References
- Unfold Class
- Replacement Operations
- Merge Operations