[storm] Store factory for ZStorm

Stuart Bishop stuart.bishop at canonical.com
Wed Jul 8 11:05:19 BST 2009


On Tue, Jul 7, 2009 at 12:25 AM, Gustavo Niemeyer<gustavo at niemeyer.net> wrote:
> 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.

Should the uri argument to ZStorm.get and ZStorm.create get dropped
too or left for backwards compatibility?


-- 
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/



More information about the storm mailing list