[PING][merge] Registry

Robert Collins robertc at robertcollins.net
Thu Sep 21 22:13:56 BST 2006


On Thu, 2006-09-21 at 10:57 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > On Fri, 2006-09-15 at 17:17 -0500, John Arbash Meinel wrote:
> >> Except not all of the objects are going to be lazy. The point is that
> >> Registry is going to be used in places where you may already have the
> >> object/class/whatever, and in someplaces you will only know that there
> >> is one *over there*. 
> > 
> > Seems to me that a subclass of the LazyLoader which is given the real
> > object would fit this quite well, with no loss of generality.
> > 
> > -Rob
> 
> Not really. LazyLoader is designed so that it replaces an existing
> object once it is used (a member is called on it). Which means it is not
> suitable for constants, and sometimes not for class definitions.
> (constants may not have members, and class definitions are occasionally
> used as isinstance(foo, Klass), which doesn't trigger an import).
> 
> But more importantly, Registry is meant to be used as a 'load this on
> request' not a 'load this once I use it'. It is a subtle but important
> difference.

I think that difference makes it more important, not less, that the
Registry container be just a regular dictionary, and the objects in it
be the things that can load on request, not on access.

Perhaps we are talking past each other ?

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060922/b216a848/attachment.pgp 


More information about the bazaar mailing list