in reply to CGI::Application, have I made a big mistake.
"nah, you gotta control the users path. Lead them by the nose or they will get it all wrong!". This would mean a rewrite to allow each run_mode to pass the user directly to one and only one run mode for the next phase.I personally don't know what your friend is talking about (control the path?). As for rewriting each run_more to apss the user ... how are you storing the session (form) data? If it's a single form submit/validation cycle, one run mode is fine (present form, if validate, do whatever, redirect to success page, else re-present form with some error messages).
You could have a separate run mode just for validation
but having a single run mode (present_validate) instaed of two would be just fine. If it gets more complext than present_validate (2 in 1), then you need to split it up.present_form -> validate_form -> success -> present_form
If it's a set of forms (multiple pages to submit, you have to store the session on the server), then a group of run modes is reccomended (each successfull submit leading to the next form/run_mode).
One of my questions is this: should run-modes be kept should and simple perhaps handling only a part of a sungle site function? For example, for an administrator to select and view user profiles, should the saearch, select, view and edit each be a separate run_mode or is it, in your opinion, okay to combine them into one run_mode?I would say that's not ok. You're basically going against the design methodology behind CGI::Applicaton (read the "USAGE EXAMPLE" in the docs). Stick to one operation per run mode (it easier to think about it if you use templates. You basically have 1 template for every run mode. If you ever find yourself using more than 1 template, and keep in mind i'm not talking about includes, but two distinct templates for one run mode, you need to split that run mode into two).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: CGI::Application, have I made a big mistake.
by jdtoronto (Prior) on Nov 25, 2003 at 00:40 UTC |