[Zope] Model-View-Controller in Zope

Paolo Bizzarri p.bizzarri at icube.it
Mon Jul 19 11:08:23 EDT 2004


Hi everyone,

we are trying to implement a concept like Model-View-Controller in our 
application, PAFlow.

PAFlow is an open source application for document tracking in public 
administrations. So it includes a lot of forms, in which users have complex 
interaction with the application itself.

We have been increasingly in difficult in using the traditional Zope approach, 
based on contents that present themselves to the user. Our interaction was 
(and is) more rich and more structured than the traditional interaction with 
a standard web content.

Based on this, we have started developing a sort of Controller object, that is 
in charge of interacting with the user. Basically, a Controller is behind a 
complex web page (for example, the selection of products for a shopping 
cart). A Page Template is in charge of making the HTML rendering, without any 
specific business logic.

The advantages are many:

- good domain model for our system, (no presentation code);

- all the presentation logic in the controller;

- no presentation logic in the page template associated;

- no business logic in the page template (only getMethods from the 
controller);

- all references from the template are to the controller only;

- no need to pass arguments in hidden fields or in the URL;

- real objects, not fields in a session, for storing information.

The only real doubt is that this approach seems not really Zopish, so we were 
wondering if there are other, more Zopish way of doing things.

Best regards.

Paolo

-- 
Paolo Bizzarri - President - Icube S.r.l.
Address:   	Via Ridolfi 15 - 56124 Pisa (PI), Italy
E-mail:	p.bizzarri at icube.it	Web:	http://www.icube.it
Phone:	(+39) 050 97 02 07	Fax: 	(+39) 050 31 36 588


More information about the Zope mailing list