DOM Impl: Array or Linked List?

keshlam at us.ibm.com keshlam at us.ibm.com
Thu Mar 11 15:06:37 GMT 1999


As a contrasting point, my com.ibm.domimpl operates on the linked-list
approach. I considered changing that, but decided that for the applications
I anticipated folks to be writing in Java, integer indexing was going to be
relatively rare compared to next and previous, and performing the
additional work to maintain the indices didn't feel like it was going to be
a net gain.

I'm firmly convinced that there's no such thing as one best way to
implement the DOM. There are too many issues to trade off which will make
an implementation better at one thing than another. The fastest DOM may
need more storage space for the model; the smallest model may require more
code; the smallest code may be slower. Also, don't forget that the DOM is
strictly an API, which can be wrapped around any model that can contain a
document; there may be DOMs which are really just thin access layers for
databases, for example.

Pick, or write, the DOM that suits your intended application(s). Hammers
make poor screwdrivers, and vice versa.



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list