[XML-SIG] The '_' thingy

Mike Olson Mike.Olson@fourthought.com
Mon, 26 Jun 2000 18:21:09 -0600

Jim Fulton wrote:
> Mike Olson wrote:
> >
> > So, I think I see this as a general concensius:
> Are you kidding?

No.  '_' issues aside I think most people want attribute access.  I
didn't tally a vote or anything, but that was the sense I got.  Am I

> > 1.  DOM will never (in forseeable future) be used over an ORB, so the
> > IDL should be used as a guide.
> Uh, this doesn't make sense.

We don't need to stick strickly to IDL (I don't think that was the
original intention), because we won't be doing distributed DOM for a

> >
> > 2.  Most people will access the DOM via attributes.
> Who says? What do you have to support this? Most people
> will access the DOM through whatever interface we define.

Again, just the sense I got.

So where are we at on the attribute vs. accessor debate?

I throw in my hat for attribute

> Whatever path we start down, it should begin with a draft
> that documements the DOM mapping for Python.

Agreed, but I think we can work out some of the larger issues on the

> > A
> > langauge mapping is something we can put into the next release of 4DOM
> > (something we've been meaning to do any ways).  The rest of the cahnges
> > are actually in place (unless we define a different callback naming
> > convention).  We will be slowly depricating _get_* soon as well.
> > However we will still need __setattr__ callbacks in some cases....

> In summary, I think using attribute-based access for the Python DOM
> API would be a mistake because it will make efficient DOM implementations
> harder than necessary to create. I'd prefer to see accessor functions used
> to provide access to DOM attributes.
> There has, however, been relatively lettle discussion on this.
> I'm curious what opinions others have.

Jim, I don't see your arguements.

How is n.firstChild less efficent the n.get_firstChild() ?

In the first, you modfy appendChild, et al and at the end put in if
self.childNodes[0] == newNode: self.firstChild = newNode

In the second you do a "return self.childNodes[0]"

I don't see a major memory or speed difference?  You can do the same for
all other attributes.

I don't see how accessors call get around circular references either. 
Believe me we have tried with this one.  We have come up with a few
schemes in our time, proxied nodes and such, but nothing that made it
worth the overhead.  Its much simplier/efficient to have a utility
function to clean up a tree if you need it too.


> Jim
> --
> Jim Fulton           mailto:jim@digicool.com   Python Powered!
> Technical Director   (888) 344-4332            http://www.python.org
> Digital Creations    http://www.digicool.com   http://www.zope.org
> Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
> address may not be added to any commercial mail list with out my
> permission.  Violation of my privacy with advertising or SPAM will
> result in a suit for a MINIMUM of $500 damages/incident, $1500 for
> repeats.

Mike Olson				 Principal Consultant
mike.olson@fourthought.com               (303)583-9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
Software-engineering, knowledge-management, XML, CORBA, Linux, Python