[XML-SIG] Ugh! Why are DOM access methods spelled with a leading '_'?
Martijn Faassen
faassen@vet.uu.nl
Mon, 10 Jul 2000 16:55:44 +0200
Paul Prescod wrote:
Answers from my perspective (MetaKit DOM, also Zope):
> Attributes:
> * arguably more Pythonic (=easier to use)
Agreed, though possibly harder to deal with security-wise.
> * faster for non-computed attributes
In MetaKit DOM, all attributes are stored in the MetaKit backend. So
for my particular DOM implementation this argument doesn't hold.
> * slower for computed attributes
> * more like Javascript, VB and COM-like languages (C# :) )
>
> Methods:
> * slower for non-computed attributes
In the case of MetaKit dom this argument does not apply.
> * faster for computed attributes
> * harder to implement
I really don't understand this. Methods are really far easier to
implement than computed attributes!
> * more like Java
* Easier to supply existing objects with DOM interface.
> There are no killer arguments here, just different weights applied to
> the various features. I don't think that we are going to agree to break
> code today. Maybe later we'll see that there are more DOM implementors
> than clients and their ease of implementation will take precedence.
Here's another one. :)
Anyway, I already implemented computed attributes through __getattr__()
(roughly following 4DOM, though I read in this thread they changed this
later). In my case it's not a huge problem, as my python objects are
basically proxies on top of the underlying database (so I don't have to
integrate with existing objects, like you'd want to do in Zope).
Regards,
Martijn