[Zope-CMF] Re: CMF and Five views: hooking up "POST"

yuppie y.2005- at wcm-solutions.de
Mon Oct 17 09:24:26 EDT 2005


Hi Lennart!


Lennart Regebro wrote:
> On 10/17/05, yuppie <y.2005--E2EsyBC0hj3+aS/vkh9bjw at public.gmane.org> wrote:
>> I know that pattern, but I don't like it. [...]
>> The code on the goldegg-folder_contents branch processes the input in
>> the __call__ method of the view class. The template is only invoked if
>> needed. It's much cleaner to use the template just for displaying
>> results, not for triggering controllers.
> 
> That's purely a matter of taste. From a principal standpoint I don't
> think there is any difference, really.

I don't think so:

1.) If you start rendering the default view before the controller has 
finished you need extra code to abort the rendering if necessary. E.g. a 
tal:condition that wraps the whole template.

2.) A cleaner separation of controller calls and view rendering makes 
the code simpler and therefore easier to write and maintain.

3.) Rendering useless views wastes resources.


Cheers,

	Yuppie



More information about the Zope-CMF mailing list