in reply to HTML forms ... "whew!" Advice?
My comment will likely be more consoling than useful: I've been writing CGI constantly for 10 years and I have never solved this problem in a way I find satisfactory. The client side is a great place for it because it's fast, flashy, and saves server load. The server side is necessary because user input can't be trusted. The presentation/view has to carry feedback; maybe in more than one dialect (XHTML/JSON). The model must be respected (built-in constraints) and the business side of the model must be protected and both will be used is a disconnected from the view/controller fashion so it might end up carrying its own layer. Now we're up to at least three points of validation + exception and feedback handling and let's not even speak of il8n.
If this were solved right... it would be in a fat model (business logic/constraints built into the model interaction) which exported information and exceptions thoroughly enough to automate the control and view layers completely. There are two points here, there must be a "validate" method in addition to a "create/update" method. I suppose in DBIC parlance, Result->new() would do validation/checking while Result->create_or_update would do that after passing the validation checks in ->new. You see a problem immediately though. Your framework is now married to a model class. FormFu has made some strides here. I've adopted it lately and I'm not sorry yet. Still, it's not hitting the sweet spot that makes me feel like the search is over.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML forms ... "whew!" Advice?
by locked_user sundialsvc4 (Abbot) on Jan 09, 2009 at 20:18 UTC |