EMF Modeling Operations
Last Updated on Thursday, 30 September 2010 10:08 Written by Administrator Monday, 27 September 2010 16:23
Predefined automatically applicable composite operations such as refactorings are a prerequisite for efficient software modeling. Some modeling environments provide an initial set of basic refactorings, but they hardly offer extension points for user-specified refactorings. Even if extension points exist, the introduction of new refactorings requires programming skills and deep knowledge of the respective metamodel of the used modeling language.
is an EMF based framework for specifying and executing composite operations within the user's modeling language and editor of choice. Comparable to macro recording in Microsoft Office products, a new specification is created by demonstrating the composite operation, fine-tuning the automatically derived operation's pre- and postconditions, and, if necessary, adding additional augmentations such as iterations using the so-called Operation Recorder.
Once a model operation is specified, it may be recurrently applied to arbitrary models using the Operation Execution Engine. This engine enables a time-saving repetition of recurring refactoring in modeling environments. Moreover, to help developers retrospectively understanding a model's evolution, applications of specified model operations, applied between two successive versions of an evolving model, may be detected a posteriori using the Operation Detection Engine.
The Specification Process at a Glance
The specification of new composite operations follows a two-step specification process:
Phase 1: Modeling. First, the user creates the initial model containing all essential model elements to apply the composite operation. Next, each element of the initial model is automatically annotated with an ID, and a so-called working model, i.e., a copy of the initial model for demonstrating the composite operation, is created. The IDs preserve the relationship of the original elements in the initial model and the changed elements in the working model. Finally, the user performs the complete composite operation on the working model in her familiar modeling environment by applying all necessary atomic operations. The output of this step is the revised model, which is together with the initial model the input for the second phase of the operation specification process.
Phase 2: Configuration & Generation. Due to the unique IDs of the model elements, the atomic operations of the operation may precisely be determined automatically using a state-based comparison. The results are saved in a diff model containing all detected atomic changes. Subsequently, an initial version of the pre- and postconditions of the operation is inferred by analyzing the initial model and revised model, respectively. Sometimes, the automatically inferred conditions do not completely express the intended pre- and postconditions of the operation. Thus, they only act as a basis for accelerating the operation specification process and may be refined by the user. In particular, conditions may be relaxed, enforced, and modified and further annotations such as iterations and user inputs may be specified. Finally, the Operation Specification Model is generated, which is a self-contained and complete description of the specified operation consisting of the initial and revised model, the diff model, and the pre- and postconditions.
The specification is supported by the Operation Recorder which is depicted in the following screenshot:
Install EMF Modeling Operations
To install the Operation Recorder and the Operation Execution Engine, please use our update site:
http://www.modelversioning.org/updatesite/
If you are unfamiliar with installing eclipse plug-ins from update sites, please follow the steps shown in the installation screen cast or consult the help pages of eclipse. Our plug-ins has been tested for Eclipse Galileo and Helios. Be sure to install all required plug-ins first! The easiest way to satisfy all dependencies is to download and install EMF Modeling Operations in the latest Modeling Bundle (including incubation).
How to use EMF Modeling Operations
To get a first idea on how to use EMF Modeling Operations, please refer to the following screen casts (steadily extended):
- How to specify and execute the refactoring Extract Operations into new Super Class for Ecore Models
- How to import and execute operation specifications
- How to specify and execute the refactoring Introduce Composite State for State Machines (custom metamodel and GMF based editor)
WARNING: outdated version of EMF Modeling Operations
Basically, you can specify operations for any ecore-based modeling languages (including Ecore itself), given the metamodel and an associated (diagram or tree) editor is registered in your Eclipse installation.
For specifying pre- and postconditions, any valid OCL expressions can be used. If you need to refer to values of other model elements in these expressions, please use the notation #{template-name}. For instance, use #{EClass_0}.name to refer to the name of the model element associated to the template EClass_0. You can also refer to simple values of the initial model (before the operation has been applied) from postconditions, using the template prefix initial, as for instance #{initial:EClass_0}.name.
A detailed help document is currently under development!
Get involved!
We kindly invite you to contribute and participate in any sort. We would be very happy, if you either
- send us some operation specifications you would like to share,
- give us some comments on what you think,
- report bugs,
- request and/or contribute new features, or
- provide screen casts or documentation.
To do so, please use the EMF Modeling Operations project page (forums and tracker) at sourceforge. Thank you!
Get the sources
EMF Modeling Operations is developed under the EPL and its source code is hosted at sourceforge:
https://sourceforge.net/projects/emfmo/
We kindly invite you to download the source code, test, use, and evaluate EMF Modeling Operations! Please use the sourceforge project page (forums and bug tracker) to post questions, comments, bugs, and feature requests!
Evaluation: Existing Operation Specifications
We have successfully used EMF Modeling Operations to specify numerous composite operations and refactorings for Ecore and UML 2. We will soon provide some examples in the (executable) operation format that you can use as a reference for specifying new operations or for registering in your environment to speed up your modeling tasks as well as to evaluate our framework. If you successfully created more operation specifications that you would like to share, please send them to use so that we can publish them here! Thanks!
- Coming soon!
Publications of EMF Modeling Operations, Operation Recorder, etc.
- 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.