support definition to new XML file definition. Refac-
torings are not hand coded, but they are assembled
from elements of the refactoring repository. It is al-
ways necessary a complete set of queries and trans-
formations, but if this requirement is fulfilled, refac-
toring definition is completed.
The tool guides the construction process, showing
current elements in the refactoring repository and al-
lowing their selection and coupling, using a wizard. A
second phase appears when the user needs to run the
refactoring on real code. Now, previous pieces work
together to put the refactoring in motion. Although
there are not different results between the solutions
(hand coded or generated), maintenance problem is
solved in a smooth way. Future changes are applied
using the assistant again, in few seconds.
Some features are difficult to remove. The person
who assembles refactorings needs to know language
particular features and the repositories. Nevertheless
this problem was also present in previous solutions.
On the other hand, both of them, static vs. dynamic
methods, can be simultaneously included in the same
tool without problems.
6 RELATED WORKS
Some approaches to the language independence prob-
lem in refactoring are based on metamodel solutions
as FAMIX (Tichelaar, 2001) and its refactoring en-
vironment named Moose (Nierstrasz et al., 2005).
This tool includes a refactoring framework that al-
lows some kind of source analysis. Nevertheless,
code changes remain language specific using Refac-
toring Browser (Roberts, 1999) for Smalltalk and a
text-based approach for Java.
In the same line, (Van Gorp et al., 2003) develop a
new solution based on metamodels. Authors propose
eight additive and language-independent extensions
to the UML 1.4 metamodel, which form the founda-
tion of a new metamodel named GrammyUML, very
similar to the Fujaba metamodel (Burmester et al.,
2003), since they use the visual language named
SDM (Story Driven Modelling) to describe refactor-
ing preconditions. Some problems about representa-
tion completeness which force to add new features to
the SDM language appear. Refactoring operations are
run as graph rewriting in Fujaba. Neither reuse of
refactoring elements, nor declarative refactoring were
faced in this work.
In (Kniesel, 2006), author works in refactoring
composition with the aim to simplify a sequence of
refactorings. The main goal is to ensure atomic ex-
ecution of a refactoring chain by creating a single
equivalent conditional transformation. The proposal,
named ConTraCT, was applied to the Java language,
since language independence was not faced. There is
no XML support, although conclusions of that work
could be considered valid for our proposal.
The aim of independence of source core model,
target programming language and code manipulation
language, using XML as unique tool is described in
(Mendoc¸a et al., 2004). Although XML use gives a
great independence, queries and updates are rewritten
for each new schema (language programming), and
refactoring construction requires to work with XML
and other derived technologies, without aided sup-
port.
Refactoring tools available today as Refactoring
Browser (Roberts, 1999), Refactor-Pro (Inc., 2007),
Eclipse (Frenzel, 2006), etc, also include a refactor-
ing engine, but it is not available a smooth way to
define, reuse, construct and evolve refactorings. Lan-
guage independent support is weak or completely ab-
sent, some steps are given by Eclipse offering a lan-
guage independent part mainly at refactoring scheme
and GUIs construction.
7 CONCLUSIONS
The framework and solution described in this paper
reduce the need to build refactorings from scratch,
and evolve previous refactorings with a relative low
effort, as long as repository items are available. Our
proposal allows developers to enrich the refactoring
offer as long as to tune, enhance, or upgrade the al-
ready offered refactoring operations. The approach
provides certain kind of dynamism in refactoring con-
struction and evolution. Furthermore, if refactorings
can be seen as compound actions, our solution sup-
ports the use of refactorings as high level actions lead-
ing to more complex refactoring operations.
We developed the framework with the refactor-
ing engine and the language independent treatment,
based on the metamodel core with extensions points
as hooks and the particular extensions for each lan-
guage (Java delivered, C# and Eiffel in process). The
proposal presented in this paper on dynamic construc-
tion and evolution based in XML and reflection is
available as a prototype.
Starting from our previous experiences develop-
ing this prototype, we are currently developing a plug-
in for Eclipse with Java, with the same functionalities.
In the same line, .NET platform is being included in
the tool. Models and frameworks should be extended
through hook methods, to include .NET features.
Furthermore, new possibilities emerge. Develop-
ICSOFT 2008 - International Conference on Software and Data Technologies
218