[Zope3-dev] Re: ObjectHub
Gary Poster
gary@zope.com
Sun, 08 Dec 2002 07:59:10 -0500
I'd be happy with either of these solutions, or even with leaving things
as is (gosh, I'm so agreeable ;-). I think these two approaches might
be a mild improvement, though.
Steve, what can you live with?
Gary
Casey Duncan wrote:
> Do you care what the hubid is if the object was already registered?
>
> Perhaps to make register and unregister behave symmetrically, you should
> have register return the hubid only if the object was a new register and
> None if not. Unregister would return a bool. Then the code code be:
>
> register_count = 0
> for ob in objects:
> hubid = objecthub.register(ob)
> if hubid is not None:
> register_count += 1
>
> I dunno. Does it really matter to the application if register does any work?
> When is that important? If not then I say it should just always return the
> hubid.
>
> -Casey