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

Sorry if I misunderstand but... 

It seems that the Visitor pattern makes it "easy" to vary operations
performed on a set of types at the expense of making it "difficult" to
add new types to the set. If you want to extend the Node interface to
many subtypes, isn't Visitor the opposite of what you need? 

Another possibility is that you intend to create a large (but stable)
set of Node subtypes and then flexibly write operations against the
extended hierarchy. This could be a good way to use the Visitor pattern,
but the Visitor interface includes methods like:
VisitConcreteElementA(ConcreteElementA);  which requires the Visitor
interface to know all ConcreteSubtypes on which it can act when it is
written. If that interface is included in the DOM, doesn't it preclude
client code adding new Node subtypes that can be "Visited"?

Jim.

____________________________________________________________
James Melton                 CyLogix
609.750.5190                 609.750.5100
james.melton@cylogix.com     www.cylogix.com

Received on Tuesday, 20 March 2001 16:44:24 UTC