in reply to Re: CGI::Application, have I made a big mistake.
in thread CGI::Application, have I made a big mistake.
This is a UI decision, which depends closely upon what you are trying to accomplish. Sometimes it is appropriate, othertimes no. In terms of CGI:A and how you code, it doesn't really matter, as you could support either. Supporting a lot choices is easy, just have them encoded in hrefs in the returned html. If you want to force the user on a path, just give them html that contains only a submit button with a hidden rm field indicating the next runmode.This is one of the things I thought about this evening. You are right. On the basis of what the client paying for the job wants I can modify the navigation system very easily without having to modify the code more than trivially.
Should "search, select, view and edit each be a separate run_mode"? Yes, in my opinion they should be seperated. Keep in mind that you can always factor out common code into an outside module for reuse across these runmodes.I keep thinking about this and I am becoming more and more of the view that they can and perhaps in some cases should be grouped. This keeps all of the code associated witha single template inside a single run_mode which could itself ultimately be made into a module of its own.
A few weeks ago at the Toronto Perl Mongers, Richard Dice presented a talk on an application framework he built using CGI::Application, Template Toolkit and Class::DBI. He spoke of doing something that at the time I did not understand. His idea was that you subclass CGI::A and then create a module which has all the common code in it - encryption, decryptio, authentication and such. Then you subclass that to give you the final application module. He postualted that this way you could in fact subclass CGI::A once to provide an App module and an instantiation CGI for user access and a separate module and instantiation for admins. In my case, as I have users, service providers and admins I can do it three times and have three totally controllable environments for each class of access to the site.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: CGI::Application, have I made a big mistake.
by freddo411 (Chaplain) on Nov 25, 2003 at 18:07 UTC |