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 | 10301 reads
|
Browse archives
Active forum topics |
Recent comments
16 weeks 1 day ago
16 weeks 2 days ago
16 weeks 2 days ago
38 weeks 3 days ago
42 weeks 5 days ago
44 weeks 2 days ago
44 weeks 2 days ago
47 weeks 5 hours ago
51 weeks 4 days ago
51 weeks 4 days ago