[Grok-dev] Naming of grok.provides

Sylvain Viollon sylvain at infrae.com
Thu Oct 23 04:30:42 EDT 2008


  Hello,

On Thu, 23 Oct 2008 09:33:22 +0200
Sebastian Ware <sebastian at urbantalk.se> wrote:

> Who wants to bet that people will continuously misspell
> registers_for as register_for... :) (or start misspelling
> grok.require as grok.requires)
> 
> 

  I don't want to troll, but I still prefer provides in fact. You can
perfectly get the meaning with an explanation, same as register_for.
People are not going to guess that directive, so you always need to
say: to select which interface is _provided_ by your adapter, use ...
And your going to say provided because you say that an object provides
an interface.

  I saw that it was complicated to get it because of
providedBy/implementedBy:

  Interface.implementedBy -> apply on class. Because a class implements
an interface.

  Interface.providedBy -> apply on an object. Because a object
provides an interface. An adapter is used to build an object, to add an
interface to an existing object. So I think this makes more sense to
use provides ... since you don't add functionality to a class, but on a
object. Of course you can make adapter on classes, but that's not out of
the box in ZCA.

  I think maybe the problem is that people don't known what's a class
and an object ... maybe they're not going to get what's an interface.

  This should just be explained, if it's not already the case, in the
grok tutorial. Such as: to do that blablabla. And in a note
"terminology: you used an interface, what's an interface and so on".

  If people don't known what they are doing, they will always complain
that they don't get it, so that don't work, and since this don't work
that's a bad framework. More or less.

  register[s]?_for is not so much sexy I think. provides as the
advantage to be the same than in ZCML, and have the same meaning, being
coherent.
 
  It was my opinion.

  Best regards,

  Sylvain,


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20081023/5e1ca973/attachment.bin 


More information about the Grok-dev mailing list