A new paper released early this year, "Modularly Typesafe Interface Dispatch in JPred", in which they talk about the way they've successfully added support for predicate dispatch on interfaces. This is much better than most previous approaches, as far as I can tell. It's interesting that the type inferencing in their compiler was able to help debug the compiler itself.
They make reference to the Multijava project which adds open classes and symmetric multiple dispatch - but is limited to using classes and not interfaces like JPred originally was. Open classes are a way of getting some of the benefits that the Visitor pattern without modifying as much code. More details are in this paper.
The code looks like:
class C {
void m(Object o) {
System.out.println("got a C and an Object");
}
}
class D extends C {
void m(final Object o) {
System.out.println("got a D and an Object");
super.m(o);
this.resend(o);
}
}
The 2006 paper also references, "featherweight Java", which seems to have opened up a whole range of academic possibilities.
No comments:
Post a Comment