[Zope3-dev] Re: Mini proposal: simpify presentation-lookup api
Philipp von Weitershausen
philipp at weitershausen.de
Thu Apr 1 11:38:58 EST 2004
Jim Fulton wrote:
>> In the docstrings, you talk about presentations, but the methods are
>> called {get|query}Presenter. I think they should be called
>> {get|query}Presentation. That's also inline with the service being
>> called Presentation Service, the service for Adapters being called
>> Adapter Service, etc. etc.
>
> Presenter is shorter. I'm open to even shorter names. :)
I distinctly remember you ruling explicitness in names (even if it means
long names) over short names. This is a case where I agree with this
policy of yours :)
> We can rename the service.
-1
A presentation is clear. A presentator is not. The endswith('or')
implies an actor, a (real) person doing something.
>> That's good, since I guess we'll have BrowserViews etc. provide
>> IPublished...
>
> Well, "pages" will present IPublished. I'm working on a separate
> proposal for that. :)
Right. Good!
>>> So, for example, a call like:
>>>
>>> view = zapi.getView(ob, name, request)
>>>
>>> will become:
>>>
>>> view = zapi.getPresenter((ob, request), someinterface, name)
>>
>> How will resources be looked up?
>
> resource = zapi.getPresenter((request, ), someinterface, name)
+1
>>> where often, name will be '' and can be ommitted:
>>
>> Btw, why does name default to ''. I find that a little implicit. I
>> would much rather have it default to None.
>
> No, because None is not a valid name. :)
None is *no* name. I think that's the message I want to get through. ''
is a name, an empty one...
> I've trid it both ways. It's simpler in the long run to simply say that
> unnamed things are things with empty names.
Well, I still think it's icky.
Philipp
More information about the Zope3-dev
mailing list