Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Form Processingby moritz (Cardinal) |
on Mar 25, 2009 at 10:03 UTC ( [id://753082]=note: print w/replies, xml ) | Need Help?? |
If it is done on internal representation - then how errors are supposed to be propagated to the HTML generator (which works on the key value pairs)? By having a bi-directional mapping between the internal representation and the key-values pairs How to interface with specialized data validating libraries? Callbacks might be a solution When form should be saved to the database? Obviously only when it has valid parameters - but some people also check the HTTP method and other things. IMHO saving things to a database is not job of the form processor. It could create objects that can be stored into the database with a single method call, but it shouldn't do it - that's the job of the controlling method that called the form processor in the first place. When values should be loaded from the database? Same answer as above. IMHO a form processor shouldn't talk to the database at all, at least not directly. For example the callbacks that validate input data could talk to the database, but having a form processor do that seems like over stretching its task. Could it be that you have a full CRUD framework in mind, not just a form processor?
In Section
Meditations
|
|