Title: Integrating Code Generation and Refactoring
1Integrating Code Generation and Refactoring
Amorim, Nogueira, Santos, Souza, Paulo Borba
- Qualiti Software Processes and
- Informatics Center, Federal University of
Pernambuco - Recife, Brazil
www.qualiti.com.br
www.cin.ufpe.br
2Integrating transformations
public interface IFacade extends java.rmi.Remote
ublic void updateComplaint complaint)
throws TransactionException,
RepositoryException,
ObjectNotFoundException, ObjectNotValidException,
RemoteException . . .
public class Person implements java.io.Serializabl
e private String nome ... public
Person(String nome, ) this.nome
nome public String getNome()
return nome
Code generation (implementation)
public class Person implements java.io.Serializabl
e private String nome ... public
Person(String nome, ) this.nome
nome public String getNome()
return nome
public class Person implements java.io.Serializabl
e private String nome ... public
Person(String nome, ) this.nome
nome private X x new X()
public class Person implements java.io.Serializabl
e private String nome ... public
Person(String nome, ) this.nome
nome public String getNome()
return nome
Refactoring (evolution)
Class X public String getNome()
return nome
3User-defined transformations
- Using an extension of Java with metaprogramming
constructs - more accessible to Java programmers
- semantic-based pattern-matching
- more expressive than templates
4Transformation language
Metavariable
ML class BT ltltextends SBTgtgt ATTRS MTDS
public void X.addPrefix("set") (D
obj) DN obj ...
Optional matching
Executable expressions
5User-defined wizards
- Interactive support for applying transformations
- Integrated with IDEs
- Framework and model for
- associating transformations with their GUIs (Java
beans) - creating new generators and refactorings
6(No Transcript)
7Practical experience
- Code generators and refactorings for
- working with EJB
- implementing specific design patterns
- It is easy to create new wizards
- Comprehensive set of code analysis for
refactorings - Composition of wizards
8Integrating Code Generation and Refactoring
Amorim, Nogueira, Santos, Souza, Paulo Borba
- Qualiti Software Processes and
- Informatics Center, Federal University of
Pernambuco - Recife, Brazil
www.qualiti.com.br
www.cin.ufpe.br