[XML-SIG] dom implementations

Uche Ogbuji uche.ogbuji@fourthought.com
Tue, 30 Jan 2001 07:08:24 -0700


> > It is tempting to look into ways of not having to pay this huge
> > penalty when you don't use that feature.  I've come across similar
> > problems many times when doing Python programming and wish there were
> > a general solution.
> 
> I thought about this when I added Events to 4DOM, and finally did not
> implement a way to disable them, because I was a bit in a hurry at that
> time.
> 
> I now see two solutions possible solutions:
> 
>  * have the Document instance be aware of existing listeners, and let the
> propagation methods query the document before actually propagating
> anything (this would completely disable Event propagation if noone is
> listening)

I like this idea.  Users needn't do anything by default to avoid the events 
slow-down.

Given the listeners, we should also consider having the readers use Element 
constructors directly rather than the factory functions, as long as we can 
accommodate subclasses, as we did for cloneNode.

>  * use the the hasFeature method of the DOM implementation to see if we
> want DOM L3 events (a bit as is done in the 4DOM test suite where
> namespaces are disabled at some point), and let the propagatoin know if it
> is expected to propagate anything.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python