[Zope3-dev] Re: ObjectHub

Chris Withers chrisw@nipltd.com
Sun, 08 Dec 2002 13:54:44 +0000


Gary Poster wrote:
> 
> 
> Steve Alexander wrote:
> 
>> We could be explicit about this and have an 'ensureRegistered' method.
>>
>>   def register(object_or_location):
>>       '''Register the given location.
>>
>>       Returns the tuple (hubid, is_new_registration)
>>       '''
>>
>>   def ensureRegistered(object_or_location):
>>       '''Ensure the given location is registered.
>>
>>       Returns the hubid of the location.
>>       '''
>>
>> But, I think that this a YAGNI.
> 
> 
> I would switch the two--the behavior of "register" as you have it there 
> is more of a YAGNI to my eyes, and "ensureRegistered"'s behavior is the 
> one we should have now until we actually want the extra information that 
> the other provides.i.e.:

I'm with Gary on this one. The need to know whether an object has been 
registered before feels like an edge case to me...

cheers,

Chris