User loginNavigation |
JPred -- predicate dispatch for Java
JPred extends Java to include predicate dispatch.
This is quite cool -- predicate dispatch allows for the partial implementation of methods in abstract classes so that the base class can provide common argument type checking (nulls, negative values, etc.) as well as simplifying the maintenance of the jumbo if/case statements for dispatching based on the type of an object (e.g. event dispatch) or field values. As a language design non-expert, predicate dispatch reminds of template matching in XPath, which I have found to be incredibly useful for handling special cases like "Chapter 1 shouldn't have a blank page in front of it" without messing up a working template for the more general case. I'd expect that JPred will provide a similar capability. JPred is implemented using Polyglot, and compiles JPred code into vanilla Java. Todd Millstein, the creator, used JPred to re-implement a complex chunk of event handling code and eliminated several gaps in the original dispatch code. I'm not able to appreciate the subtler parts of this work, I suspect, but the basic idea is simple enough that I could explain it to my 14 year-old son and he understood its value. By meltsner at 2005-04-08 15:15 | LtU Forum | previous forum topic | next forum topic | other blogs | 10330 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 10 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago