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@icube.it Web: http://www.icube.it Phone: (+39) 050 97 02 07 Fax: (+39) 050 31 36 588
* Paolo Bizzarri <p.bizzarri@icube.it> [2004-07-19 17:43]:
Hi everyone,
we are trying to implement a concept like Model-View-Controller in our application, PAFlow.
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.
Seems Zope enough for me, what makes you think otherwise? PageTemplates by design discourage embedding domain logic, and most product developers put their business logic in Python classes. So already there's your model and view. Not many product developers incorporate the idea of a controller into their products, because it only begins to make sense and worth the effort in more involved business apps. -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za
Hi Roche,
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.
Seems Zope enough for me, what makes you think otherwise?
PageTemplates by design discourage embedding domain logic, and most product developers put their business logic in Python classes. So already there's your model and view. Not many product developers incorporate the idea of a controller into their products, because it only begins to make sense and worth the effort in more involved business apps.
Yes and no. In Zope, as far as I understand, there are two objects: - content, that mantains information; - view (Page Templates) that provide presentation services. Our point of view is more structured: - domain objects, containing the domain application logic and information - page controllers, that manage the interaction with the user and provide encapsulation for all the presentation-related information; - last Page Templates, that provide only HTML view. Also, in our view, a Controller is a complete separate object instance, one for each user. This allows the object itself to have all the context information that are local to the object. You do not have to pass lot of context information to the object itself, beacuse each object has its separate information. What do you think ? Best regards. Paolo -- Paolo Bizzarri - President - Icube S.r.l. Address: Via Ridolfi 15 - 56124 Pisa (PI), Italy E-mail: p.bizzarri@icube.it Web: http://www.icube.it Phone: (+39) 050 97 02 07 Fax: (+39) 050 31 36 588
Paolo Bizzarri wrote at 2004-7-19 17:08 +0200:
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.
Look at CMF/Plone and especially "CMFFormController". -- Dieter
participants (3)
-
Dieter Maurer -
Paolo Bizzarri -
Roché Compaan