W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

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

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 22 Mar 2001 13:34:04 -0500
To: www-dom@w3.org
Message-ID: <OF27B71DB6.D9D057AD-ON85256A17.00652ADF@pok.ibm.com>

>The reason why myvisitor.execute(mynode) does not work is that at the
>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

Joe Kesselman  / IBM Research
Received on Thursday, 22 March 2001 13:34:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC