domain/j demos

These demos demonstrate micro-refactoring, the coding style we envisaged as the headline feature of our Java tool domain/j. This OOPSLA 2004 extended abstract (oh and this one, which has an accompanying poster) discusses the demo and product concept a bit more. This OOPSLA 2005 Onward! paper explains how trying (and conspicuously failing) to build domain/j ultimately led to what I'm currently working on, interactive programming languages, whatever they are.

Introducing micro-refactoring

Push into method
Run demo
A simple example of micro-refactoring using domain/j. We'll turn a static employeeAsString() method into the toString() method on the Employee class, using a number of refactoring micro-steps.

Moving code between existing methods

Push into method + Pull enclosing application into method
Run demo
A more complex example showing one of the most common editing scenarios: responsibility migration between two existing methods.

Migrating statements between methods

Push into following method
Run demo
Another common example of responsibility migration, where statements are moved between methods, instead of expressions.

A refactoring micro-kernel

Extract method = Introduce Method + Push argument into method + Inline Variable
Run demo
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

Extract class Pull method into argument type
Run demo
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.