The Operation Recorder
Description | The Operation Definition Process | Realization | The Graphical User Interface | Evaluation | Publications
Description
The Operation Recorder allows to specify of composite operations like refactorings for Ecore-based models by example. The user simply illustrates the refactoring by applying it to an example model within his/her preferred modeling editor. Therefrom, the Operation Recorder automatically derives a generic operation specification, which may then be manually fine-tuned.
There is also a screencast of the operation recorder in action available.
Core Features:
- language independence
- editor indpendence
- no textual programming
The Operation Specification Process
Phase 1: Modeling
The user starts the specification process by providing the initial model. This model contains all model elements which are necessary to successfully apply the composite operation. Each model element of the initial model is annotated with a unique ID. In the next step, a so-called working copy is created automatically, which is a copy of the initial model. The user applies all necessary changes of the refactoring to the working copy. The result is the so-called revised model. The IDs preserve the relationship between the model elements in the initial model and the changed elements in the revised model. Both models are the input for the second phase of the operation specification process.Phase 2: Configuration
When the revised model is completed, the Operation Recorder detects all performed atomic changes by conducting a state-based comparison relying on a sound ID-based match. Furthermore, the Operation Recorder derives pre- and postconditions necessary for the application of the composite operation. Then, the user may edit those automatically derived conditions. In particular, the conditions may be activated, deactivated, or modified. Furthermore, additional conditions, iterations, and user input variables may be introduced by the user. In the last step, the operation specification is automatically generated created. Such operation specifications may now be automatically applied to arbitrary models, which fulfil the preconditions.Realization
- Eclipse Plug-In
- Eclipse Modeling Framwork
- Applicable on any Ecore model
- Adaption of EMFCompare
- SWT/JFace for the Graphical User Interface
- currently integrated editors: Graphical Ecore Editor, GMF class diagram editor, GMF statechart editor
The Graphical User Interface
The graphical user interface consists of the following components:
1.) The Starting Page where general settings are entered:
2.) Any editors may now be used for changing the initial and the revised model.
3.) Lists containing the automatically derived pre- and postconditions. In this view, the conditions may also be edited.
4.) The final page showing the differences and allowing to introduce iterations and user input variables.
Evaluation
So far, we successfully designed the following refactorings using the Operation Recorder.
For each operation specification the initial and the revised model is depicted. The detailed specifications consist of the executed operations as well as the generated and subsequently adapted templates and conditions. For each operation there is a text file summarizing the specification linked in the following subsections. The adapted conditions in the text file are represented using the following syntax:
===== Preconditions / Postconditions ======
===== Template name =====
// deactivated feature condition which was automatically deactivated
* ( )...
// activated feature condition which was automatically activated
* (X)...
// activated feature condition which was automatically deactivated and activated manually
* (+)...
// deactivated feature condition which was automatically activated and deactivated manually
* (-)...
// edited feature condition
* (e)...
Move Attribute (mvAtt)
Diagram: Class Diagram
Description: Move an attribute of one class to an other class.
Operation Specification Model (TBD)
Initial model
Revised model
Convert to Singleton (convSing)
Diagram: Class Diagram
Description: Introduces a static method which creates one instance of a class if the instance does not exist or which otherwise returns one instance. Constructors are set to private.
Initial model
Revised model
Encapsulate Variable (encVar)
Diagram: Class Diagram
Description: Sets a public variable to private and adds a getter and a setter method.
Initial model
Revised model
Replace Data Value with Object (repDV)
Diagram: Class Diagram
Description: Removes one attribute from a class. For this attribute a new class is introduced and related the new class is related to the other class.
Initial model
Revised model
Extract Superclass (extSC)
Diagram: Class Diagram
Description: Attributes and Methods which are shared by multiple classes are extracted in one common superclass.
Initial model
Revised model
Introduce Composite State (intCS)
Diagram: Statechart
Description: States with the same transitions are grouped in one composite state.
Initial model
Revised model
Merge States (merge)
Diagram: Statechart
Description: Adjacent states are merged to one state.
Initial model
Revised model
Publications
- P. Langer, Konflikterkennung in der Modellversionierung, Master's Thesis, Vienna University of Technology, 2009
- P. Brosch, P. Langer, M. Seidl, M. Wimmer, Towards End-User Adaptable Model Versioning: The By-Example Operation Recorder, in Proceedings of the International Workshop on Comparison and Versioning of Software Models (CVSM'09) co-located with the 31th International Conference on Software Engineering (ICSE'09), IEEE, pp. 55-60, 2009.
- P. Brosch , M. Seidl , K. Wieland , M. Wimmer , and P. Langer ,
"The Operation Recorder: Specifying Model Refactorings By-Example ,"
in Companion to the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2009, ACM, pp. 791-792, 2009. - P. Brosch , P. Langer , M. Seidl , K. Wieland , M. Wimmer , G. Kappel , W. Retschitzegger, and W. Schwinger,
"An Example Is Worth a Thousand Words: Composite Operation Modeling By-Example ,"
in Proceedings of the 12th International Conference on Model Driven Engineering Languages and Systems (MoDELS'09), Springer, pp. 271-285, 2009.