[Zope3-dev] service names

Jim Fulton jim@zope.com
Tue, 04 Feb 2003 06:03:19 -0500


Jim Fulton wrote:
> Steve Alexander wrote:
> 
>> sean.bowman@acm.org wrote:
>>
>>> hello,
>>>
>>> In all the code I've seen in Z3, the second argument to getService is a
>>> string literal.  This smells bad to me -- it seems to violate Once And
>>> Only Once.  Would it be a good idea to use a constant instead of a 
>>> string
>>> literal?  For example::
>>>
>>>   getService(context, defaultHubIdsName)
>>
>>
>>
>> Why not just HubIds ?
>>
>>   HubIds = 'HubIds'
>>   getService(context, HubIds)
> 
> 
> Why not just 'HubIds'?
> 
> I really fail to see the benefit of a variable or a marker interface here.

OK, I'm convinced.

We'll change this.

Jim


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org