Re: Type-safe iteration over the DOM in DOM 2 & 3?

>The reason why myvisitor.execute(mynode) does not work is that at the
point
>where this code is called the object you are dealing with is only known to
>be of class node.

In other words, the reason you're using the accept-and-callback is because
you've overloaded execute() to select different callbacks based on the
datatype of the argument.

Unfortunately method overloading isn't supported in all languages, so the
DOM API design can't rely on it. If the architecture wants a different
callback method for each node type, they must be named differently. I wish
it were otherwise, but that's part of the cost we accepted in trying to
design an architecture that could support bindings in a wide variety of
languages.

______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 22 March 2001 13:34:17 UTC