[Zope3-dev] service names

Steve Alexander steve@cat-box.net
Thu, 06 Feb 2003 12:04:27 +0200


Sean,

Thanks for looking at this. It needed looking at :-)


> I changed the code and tests to use service names defined in
> zope/component/servicenames.py.  The names I defined are:
> 
>  * HubIds,
>  * Events,
>  * Subscription,
>  * ErrorReports for the ErrorReportingService,
>  * Roles,
>  * Permissions,
>  * Adapters,
>  * Authentication,
>  * Interfaces,
>  * Utilities,
>  * Skins,
>  * Views,
>  * ResourceService for Resources, and
>  * Factories.
> 
> I changed ErrorReports because there's already a
> zope.app.services.errorr.ErrorReportingService, and I changed
> ResourceService because there's already a
> zope.app.publisher.browser.resources.Resources. 

I think the service name should be Resources. There's no problem with a 
collision of names like this, as I can say:

   from zope.app.publisher.browser.resources import\
       Resources as BrowserResources

I think consistency in service ids is more important.

Another way of thinking about names for services is to consider that a 
Service provides a service. That is, it does something for you or gives 
you something.

* HubIds service
   The source of HubIds. It provides you with HubIds.

* Events
   Provides you with the means to publish events.
   The verb is 'to publish', so perhaps this should be renamed
   'Publication'.

* Subscription
   Provides you with the means to subscribe to receive events.

* Roles
* Permissions
* Adapters
* Interfaces
* Utilities
* Skins
* Views
* Resources
* Factories
   Provides you with the things the service is named after.

* Authentication
   Provides the means to authenticate.

* ErrorReports
   Provides you with reports about errors that have occured. However,
   these ErrorReports are provided in the same way that Skins or Views
   are provided. The service doesn't manage the error report. It merely
   collects them.


So, I propose two kinds of names:

* Plural nouns, for services that represent a collection of components
   or other things that are instrumental in a system's architecture.

   HubIds, Roles, Permissions, Adapters,
   Interfaces, Utilities, Skins, Views, Resources,
   Factories

* Nouns derived from verbs, for providing the means to do something

   Authentication, Subscription, Publication, ErrorCollection

or perhaps the participal form of the verb

   Authenticating, Subscribing, Publishing, ErrorReporting

or perhaps the infinitive of the verb

   Authenticate, Subscribe, Publish, ReportErrors

--
Steve Alexander