Wednesday, October 3, 2007

"Double Dispatching"

Double dispatching is one of my favorite techniques in Smalltalk. Its use eliminates a lot of checking of "is kind of" and if-statements. I implemented an server-based system in Smalltalk, in 1998 and 1999 that generated dynamic HTML from objects and handled the web requests and responses. This framework heavily depended on double-dispatching. I had assumed that you needed a polymorphic language to implement double dispatching and that it was not possible in Java. I found this article about how to do double dispatching in Java, so I guess I was mistaken.

No comments: