DevBooststLogoQualiTunetudLogorewerseLogo modelplexLogo
Refactory Logo
EMFText Refactoring SDK
Enabling Refactorings for your DSL just became a piece of cake

Contents

Define the participating elements

As contributed in [1], a core of refactorings can be re-used in different metamodels. This core consists of the participating elements and the transformation steps. Hence definition of the participants will be described here.

This approach is inspired by the role paradigm from Riehle and Gross from [2] in which roles are used to define collaborations between objects in different contexts.

Based on that work we introduced roles in model refactoring, too, saying that different metaclasses play another dedicated role in different model refactorings. For this purpose a new DSL was designed which is used to define role models for refactorings. In the bottom part the links to the SVN repository can be found. In the following a small example is given on how role models can be defined.

To create a new role model you have to invoke File -> New -> Other... and start the wizard EMFText .rolestext file under the category Refactory. Then an editor will open and you can define the roles being participated in your desired generic model refactoring. The following figure shows a role model with three roles intended to be used if an element has to be moved from one container to another container like, e.g., when an property of a UML classhas to be pulled up in the inheritance hierarchy.

Image:rolemodel.png

Besides the textual syntax we defined a graphical syntax, as well. Start using a graphical editor by invoking File -> New -> Other... and start the wizard Role Model diagram under the category Refactory. Then you'll get an editor like the following figure shows.

Image:rolesdiag.png

The model created with the graphical editor will be persisted with the previously shown textual syntax. That means that both textual and graphical role models are kept consistent and changes will be propagated from one representation to the other.

CS Specification

roles.cs

Metamodel

roles.ecore

roles.genmodel

Plugins

org.emftext.language.refactoring.roles

org.emftext.language.refactoring.roles.resource.rolestext

org.emftext.language.refactoring.roles.resource.rolestext.ui

org.emftext.language.refactoring.roles.postprocessing

org.emftext.language.refactoring.roles.builder

org.emftext.language.refactoring.roles.edit

org.emftext.language.refactoring.roles.diagram


  1. Jan Reimann, Mirko Seifert and Uwe Aßmann: Role-based Generic Model Refactoring, In Proc. of the ACM/IEEE 13th International Conference on Model Driven Engineering Languages Systems (MODELS), 2010
  2. Dirk Riehle and Thomas Gross: Role Model Based Framework Design and Integration

Retrieved from "http://www.emftext.org/index.php/Refactoring:RoleModel"

This page has been accessed 2,666 times. This page was last modified 15:47, 8 November 2010.