I've got a nice prototypes-based controller
<http://www.stonehenge.com/merlyn/LinuxMag/col56.html> that uses
Class::DBI to access the model data, and Template Toolkit to drive the
view. (The referenced code is not released to the CPAN yet; we're
waiting on approval.)

And I've got a paying client who is building a multi-page app using
this mechanism.  Think "shopping cart", with multiple pages and forms,
and purchased items complexity.

The problem is that the application proceeds through various steps,
and the user has various roles and subroles.  Thus, the view needs to
know for a given piece of model whether the data is mandatory,
readonly, and so on, because that changes the view.  But mandatory and
readonly are functions of the controller's state, and almost every
method I can think of sounds like updating the data in too many places.

I can't be the first person down this road.  How does this normally
get handled?  I've been staring at search.cpan.org results for the
past half hour, and my eyes are glazing over.

I'd like the controller to be able to say "this page requires these
fields which come from these model pieces, and that set of fields is
readonly, and those other fields are mandatory, and these fields are
readonly because this person is a luser".  Without typing the same
thing in three or four places.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <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!

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to