- From: Ted Bashor <bashor@crossroute.com>
- Date: Tue, 21 Jul 1998 09:53:45 -0700
- To: "Stephen R. Savitzky" <steve@crc.ricoh.com>
- CC: www-dom@w3.org
Stephen R. Savitzky wrote: > > o There is no type-safe way to convert a Node to any of its major > subclasses. The newly-added nodeName, nodeValue, and attributes > attributes help a great deal, but it would be good to have conversion > methods as well. We have, e.g., "asElement", which returns the node if it > is an Element, null otherwise. This is _much_ more efficient than > casting, which involves run-time type checking in Java. I would think that this API would be an extension useful in an implementation that optimized specifically for Java runtime speed. However I'm guessing that the average consumer of the DOM is probably going to be happy enough with their language's default type checking mechanism. The only reason I object to having it in the core spec is that from an OO point of view it is kind of ugly to have base classes A) know about all or even any of their subclasses B) have to be modified when a new subclass comes along. PS. I too am sad that there isn't at least an attempt at a Declaration node for us to give feedback on. It seems like a pretty "core" part of an XML object model. However, I am glad we have what we have now... ted
Received on Tuesday, 21 July 1998 12:50:30 UTC