These Flash movies illustrate micro-refactoring, a “semantic editing” style we envisaged as the headline feature of our Java tool domain/j. I presented this at OOPSLA 2005 with my colleague Russ Freeman. The accompanying poster discusses the demo and product concept. This follow-up Onward! paper explains the path from domain/j to my current research interests.
A simple example of micro-refactoring using domain/j. We’ll turn a static
employeeAsString()method into the
toString()method on the
Employeeclass, using a number of refactoring micro-steps.
Moving code between existing methods
A more complex example showing one of the most common editing scenarios: responsibility migration between two existing methods.
Migrating statements between methods
Another common example of responsibility migration, where statements are moved between methods, instead of expressions.
A refactoring micro-kernel
The point of the micro-refactoring approach is that it decomposes familiar refactorings into small steps, allowing macro-refactorings to be composed out of existing ones and bridging the gap between text editing and large-scale change. This example shows how Extract method breaks down into Wrap in call to identity, Push argument into method and Inline variable.
Migrating state and behaviour into classes
Moving state and behaviour in and out of classes is an important part of moving a procedural design to a more object-oriented design. This demo shows how common parameter sets can be promoted to classes, and methods pulled into the resulting classes.