RFC: centralise registries
Robert Collins
robert.collins at canonical.com
Tue Apr 14 07:11:15 BST 2009
On Tue, 2009-04-14 at 16:01 +1000, Ian Clatworthy wrote:
> Robert Collins wrote:
> > On Tue, 2009-04-14 at 15:45 +1000, Ian Clatworthy wrote:
>
> > Do you have alternate suggestions to fix the problem?
>
> Putting all subclasses of something into a module in order
> to fix a performance issue just *yells* anti-pattern to me.
> I thought we wanted to break things like builtins.py apart,
> not repeat the mistake.
Thats not what I'm proposing. In point of fact the subclasses are
already in registry.py.
I'm proposing to put the _instances_ there to allow things to register
with them rather than having to load all the code in the module the
instance currently is in.
> If we need a central location of globals that always get
> loaded, I'd create a module for that called globals.py say.
> But I'd prefer that we put as little into it as necessary
> and kept things as distributed and localised across the code
> base as we can.
I'd prefer to keep things distributed too. But I want to solve the
performance issue as well.
Another way would be to change from/extend the registration facility to
use a publish-and-respond event system.
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090414/b9f2eb5e/attachment.pgp
More information about the bazaar
mailing list