These Flash movies illustrate micro-refactoring, a “semantic editing” style we envisaged as the headline feature of our Java tool domain/j. I worked on this with Russ Freeman, Jeff Foster and a couple of others working at our company. This OOPSLA 2004 extended abstract (and this one, which has an accompanying poster) discusses the demo and product concept. This OOPSLA 2005 Onward! paper explains how trying (and failing) to build domain/j led me to what I’m currently working on, interactive programming.
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.