note
moritz
<blockquote>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)? </blockquote>
<p>By having a bi-directional mapping between the internal representation and the key-values pairs</p>
<blockquote>How to interface with specialized data validating libraries?</blockquote>
<p>Callbacks might be a solution
<blockquote>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.</blockquote>
<p>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.
<blockquote>When values should be loaded from the database?</blockquote>
<p>Same answer as above.
<p>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.
<p>Could it be that you have a full CRUD framework in mind, not just a form processor?
753076
753076