[storm] Store factory for ZStorm
Gustavo Niemeyer
gustavo at niemeyer.net
Mon Jul 6 18:25:05 BST 2009
Hi Stuart,
Thanks for bringing this up here.
> I've done this by extending ZStorm.get and ZStorm.create with a
> store_factory argument. The default factory is storm.store.Store.
>
> jamesh (who has reviewed this branch so far) felt it necessary to add a
> configure-once-first API too, so I've also added
> ZStore.set_default_store_factory to mirror ZStore.set_default_uri.
>
> Passing a factory to ZStorm seems like the cleanest way of supporting my use
> cases and is also the most flexible.
I agree with James. I'd actually go even further than this, and
define *only* the ZStorm-wide factory. So, in practice, defining a
ZStorm.set_store_factory() method and using only this factory
internally. Even if there are per-URI differences, it would be
possible to code these inside the story factory itself, so the
individual methods likely won't need additional extensions.
--
Gustavo Niemeyer
http://niemeyer.net
More information about the storm
mailing list