-
Notifications
You must be signed in to change notification settings - Fork 2
7. Member Removal
Removing the private non-static fields from the classes of the origin code is necessary because the Ecore representation already contains the same fields and access methods in the implementation classes of the Ecore code. They are automatically created when generating the Ecore code from the extracted Ecore metamodel. First, we replace all references to the fields of the classes in the origin code by equivalent access methods calls. Then, we remove the fields and their access methods. All access method calls of this class now are executed by the wrapper classes of the integration code. They are then delegated to the correspondent implementation classes of the Ecore code. As a result of this adaption, the implementations of the methods remain in the adapted origin code, while the fields are part of the Ecore code.
There is one problem with this approach: If the access methods of the origin code contain more functionality than just to get or set a field, this functionality is lost during the Ecorification process. The problem lies in the Ecore metamodel extraction. An access method generated by EMF from the extracted Ecore metamodel will differ from the original access method because the generated access methods contain no additional functionality. As a result, the access methods with the additional functionality of the origin code will be removed, and all calls to them will be delegated to the basic access methods of the Ecore code. This could be avoided by implementing a strategy to retain the code of the access methods, but this feature is currently not implemented.