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: Peter Meyer <petermeyer99@hotmail.com>
Date: Thu, 22 Mar 2001 20:14:05 -0000
To: keshlam@us.ibm.com, www-dom@w3.org
Message-ID: <F224Ka9YAFGobrh7ZF8000096fa@hotmail.com>
A very good point... and on top of that, as just discovered in my 
side-discussion with James, I was in error assuming that the base visitor 
interface would just need to declare the execute(Node) method, while other 
ones could be added in subclasses or implementors. Unfortunately, the base 
class needs to have all methods listed, so that my idea of easy 
extensibility does not quite work.


>From: "Joseph Kesselman" <keshlam@us.ibm.com>
>To: www-dom@w3.org
>Subject: Re: Type-safe iteration over the DOM in DOM 2 & 3?
>Date: Thu, 22 Mar 2001 13:34:04 -0500
>
>
> >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
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Received on Thursday, 22 March 2001 15:14:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT