Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Refactorings for Xpand / Xtend / Check"

m (Updating link to oAW)
 
Line 12: Line 12:
 
is done by specifying formal models (e.g. UML (Unified Modeling Language) models), of which running code, the (concrete) technical implementation, is generated.
 
is done by specifying formal models (e.g. UML (Unified Modeling Language) models), of which running code, the (concrete) technical implementation, is generated.
 
The code generation is a multistep process. After specifying the formal functional models based on one or more metamodels they are in turn transformed into other models. At each transformation step a model is checked against the metamodel(s) to detect modelling errors. At a final step software artefacts, e.g. classes or configuration files, are generated.
 
The code generation is a multistep process. After specifying the formal functional models based on one or more metamodels they are in turn transformed into other models. At each transformation step a model is checked against the metamodel(s) to detect modelling errors. At a final step software artefacts, e.g. classes or configuration files, are generated.
Xpand, Xtend and Check are languages that comprise the generator framework [http://www.eclipse.org/gmt/oaw openArchitectureWare (oAW)]. These three languages are used to build custom code generators. Xtend is used for model transformations, Check for model validations and Xpand for controlling text generation. Besides these languages oAW offers tools, that extend the Eclipse IDE, to simplify the development of a code generator.
+
Xpand, Xtend and Check are languages that comprise the generator framework [http://www.eclipse.org/workinggroups/oaw openArchitectureWare (oAW)]. These three languages are used to build custom code generators. Xtend is used for model transformations, Check for model validations and Xpand for controlling text generation. Besides these languages oAW offers tools, that extend the Eclipse IDE, to simplify the development of a code generator.
 
Since a code generator is a software product itself, it is subject to decreasing code quality as its code base grows. The code quality maintenance can be achieved by applying refactorings to it. A refactoring is used to change the code's structure or the naming of artefacts to improve its readability and thus its maintainability without changing its functional behaviour. Refactorings can be very labour-intensive. The amount of time spent for refactorings can be reduced to a minimum by automating it.
 
Since a code generator is a software product itself, it is subject to decreasing code quality as its code base grows. The code quality maintenance can be achieved by applying refactorings to it. A refactoring is used to change the code's structure or the naming of artefacts to improve its readability and thus its maintainability without changing its functional behaviour. Refactorings can be very labour-intensive. The amount of time spent for refactorings can be reduced to a minimum by automating it.
 
The goal of this project is to create a refactoring support for the oAW's Eclipse tools to achieve a higher maintainability of code generators comprised of Xpand, Xtend and Check files.
 
The goal of this project is to create a refactoring support for the oAW's Eclipse tools to achieve a higher maintainability of code generators comprised of Xpand, Xtend and Check files.

Latest revision as of 12:47, 8 November 2011

This project is part of the Google Summer of Code 2008

Mentor: Peter Friese

Student: Steven Reinisch

Abstract

Model Driven Software Development (MDSD) describes an approach to Software Engineering that comprises the separated specification of a system's (abstract) functionality and its (concrete) technical implementation. The description of a system's (abstract) functionality is done by specifying formal models (e.g. UML (Unified Modeling Language) models), of which running code, the (concrete) technical implementation, is generated. The code generation is a multistep process. After specifying the formal functional models based on one or more metamodels they are in turn transformed into other models. At each transformation step a model is checked against the metamodel(s) to detect modelling errors. At a final step software artefacts, e.g. classes or configuration files, are generated. Xpand, Xtend and Check are languages that comprise the generator framework openArchitectureWare (oAW). These three languages are used to build custom code generators. Xtend is used for model transformations, Check for model validations and Xpand for controlling text generation. Besides these languages oAW offers tools, that extend the Eclipse IDE, to simplify the development of a code generator. Since a code generator is a software product itself, it is subject to decreasing code quality as its code base grows. The code quality maintenance can be achieved by applying refactorings to it. A refactoring is used to change the code's structure or the naming of artefacts to improve its readability and thus its maintainability without changing its functional behaviour. Refactorings can be very labour-intensive. The amount of time spent for refactorings can be reduced to a minimum by automating it. The goal of this project is to create a refactoring support for the oAW's Eclipse tools to achieve a higher maintainability of code generators comprised of Xpand, Xtend and Check files. One challenge is the fact, that extensions comprising XTend files can be used within XPand and Check files. Thus a local change to an extension is not only limited to the extension space. Another challenge is that the basis for a generator are one or more metamodels. Changes to them have an effect on all XTend, XPand and Check files. To reduce the implementation effort, the existing Eclipse refactoring and JDT (Java Development Tools) infrastructure will be used. Special attention will be paid to the LTK (Refactoring Language Toolkit), which offers an API for refactorings.

Poll

The poll has been closed. Thanks for participating!

Progress

The poll's results can be found here.

Legend

Glass.gif Needs some investigation/research

Progress.gif Work in progress

Ok green.gif Feature implemented

We will focus our implementation efforts on the following features:

  • rename Xpand/Xtend/Check/MWE file (resource) Ok green.gif
  • XTend: rename extension Ok green.gif
  • XTend: extract extension Ok green.gif
  • XTend: move extension Ok green.gif
  • XPand: rename DEFINE Ok green.gif
  • XPand: extract DEFINE Ok green.gif

I added the following features:

  • rename package
  • move Xtend/Check file

The move refactoring is not enabled for Xpand files yet. The reason is the namespace handling, which is different from Xtend files. I still find test cases the actual implementation is not working for. I have to rethink my abstractions, since the ones used for the features implemented so far do not fit that well for the namespace handling in Xpand files.

UI
I added an action set to the menu bar allowing for undo of oAW refactorings and showing the refactoring history. Now, you do not need to mark the whole extension/define signature to refactor it as shown in the old screencast. Just right click somewhere within the extension/define as you are used from jdt refactorings.

Getting the source

__ please enter __

Back to the top