[bind10-dev] config data api

Michal 'vorner' Vaner michal.vaner at nic.cz
Tue Apr 17 08:01:04 UTC 2012


Hello

On Mon, Apr 16, 2012 at 11:13:17AM -0700, JINMEI Tatuya / 神明達哉 wrote:
> > AFAIK, you can assign anything to anything in python, except to
> > primitives, so no. But we could indeed duck-type their primitives'
> > behaviour on top of these. Not sure if we should, though, it would add
> > a lot of potentially confusing implicitness.
> > 
> > We can of course start out by skipping all of this and just doing the
> > specifications classes and see if that makes it all easy enough :)
> 
> Right now I don't have a fixed opinion on the appropriate abstraction
> level for these notions.  But, in general, this seems to be a common
> tradeoff issue between the flexibility of lower level representation
> and the safety provided by higher level interfaces.  If the
> application can have full access to the most low level representation
> it's sometimes easy and can complete missing features by manipulating
> the data itself.  Getting the "default" value may be one such thing.
> On the other hand, if any application can get access to the lowest
> level implementation, all others need to worry about various corner
> cases such as the configuration integrity is magically broken in the
> middle of a process.  To make the system safe in such an environment
> the implementation will be more complicated.

I think we are talking about different things. I'm talking about the current
python ability to call:
for value in config_list: # Because it is a real list
  do_something(value)

and:
rpc_call(params={'x': [1, 2, 3], 'y': [4, 5, 6]})

Instead of stuff like:
params = NewMap()
x_param = NewList
x_param.append(1)
x_param.append(2)
x_param.append(3)
params.insert('x', x_param)
…

The second is far more tedious and far less readable than the first and I'd like
to avoid it.

With regards

-- 
chown -R us $BASE

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20120417/e8ca604a/attachment.bin>


More information about the bind10-dev mailing list