[XML-SIG] Python DOM Unification -- level

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Mon, 26 Apr 1999 23:47:01 -0600


> Following are some meta-questions on the proposed Python DOM unification.
> 
> First, what is the appropriate level of unification? 
> 
>  * Module level:
> 
> if sys.argv[1]=="fast":
>     from xml import minidom
>     dom = minidom
> else if sys.argv[1]=="complete":
>     from xml import dom
> else if sys.argv[1]=="distributed":
>     from 4thought import dom

Hmm.  The last line would throw an exception.  We have thought a bit about 
packaging for 4DOM: currently we use "DOM" as top level, but we understand 
that this might not play nicely with other DOM libs in the path.

>  * Builder level:
> 
> if sys.argv[1]=="4thought":
>     from 4thought.dom import sax_builder()
> else:
>    from xml.dom import sax_builder()
> 
> xml.dom.FromXML( sax_builder() )
> 
>  * Document level:
> 
> if sys.argv[1]=="4thought":
>     4thought.dom.Gimme.a.document()
> else:
>     xml.dom.I.need.a.document()
> 
> document.doStuff()
> 
> My preference is for "Builder level", I think. Portable helper functions
> could go into a universal xml.dom package instead of into each package.

Agreed.  Each implementation would know how to build its own concrete objects, 
and the unified interface (if we're able to pull that off) will allow 
transparent manipulation of heterogenous nodes within an app.

-- 
Uche Ogbuji
FourThought LLC, IT Consultants
uche.ogbuji@fourthought.com	(970)481-0805
Software engineering, project management, Intranets and Extranets
http://FourThought.com		http://OpenTechnology.org