I have a traditional "gather information over 10 pages" app in Perl that
I'm
rewriting using Seaside and Magritte. The current app stashes everything in a
giant Perl hash (saving and loading from hidden vars) at each step.
Sometimes, the presence or absence of (or even repetitions of) a field depends
on previous questions answered on previous pages. When I started to model
this with Magaritte, I quickly hit some roadblocks trying to implement the
dynamic "descriptionFoo" since these are (a) cached and (b) have no access to
"self" since they are class-side. So I've managed to come up with
something
that sorta works instance-side, but I'm not very happy with it, as I wonder
for example how many times "myModel description" will be called during a
render, and whether I should try to cache that. I also am ending up with a
series of subclasses of a parent class that holds the entire collected values,
but has only the items of interest. None of this seems very clean, and it
seems like I'm reinventing some wheels.
Does anyone have some examples of how to do things like a basic "gather info
from a multipage query, some of which depends on earlier answers" task would
work and look like?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn(a)stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See
PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!