[Zope3-dev] service names

Jim Fulton jim@zope.com
Mon, 27 Jan 2003 11:38:21 -0500


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.

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