DOM3 Core: DOMImplementationRegistry Behavior

The implementation of DOMImplementationRegistry shown in Appendix
G.1 makes use of a Java System Property to record a list of names
of classes that implement DOMImplementationSource. A user of the
registry may naturally infer that sources are
checked in the order specified by this property (and the order by
which additional sources are added to the registry using the
addSource() method). However, this may or may not be the case since
the implementation of DOMImplementationRegistry shown here makes
use of a Hashtable which does not guarantee any specific enumeration
order.

I would suggest doing one of the following:

1. abstract the definition of DOMImplementationRegistry in
Appendix G.1 to specify it in terms of an interface rather than
a class; furthermore, define its behavior more clearly in
terms of order of evaluation in the case that two or more
DOMImplementationSource instances implement the same features;

2. rewrite the implementation in G.1 to use an ordered
container type, such as a List;

3. specify that the behavior is undefined as to which
DOMImplementationSource will be returned when more than one
supports the same features.

Regards,
Glenn

Received on Thursday, 19 June 2003 17:10:05 UTC