Originally Posted by kyberfabrikken
I think that the overall layout of this construct should follow the basic MVC seperation. A FormModel (probably equal to the DataSource), a FormView (which is the code that renders the form) and a FormHandler. I'm sure we can agree on the responsibilities of the first two components, while the latter (the FormHandler) may be an object of discussion.
The FormHandler may be a generic object, which the application-programmer provides with a FormModel and a FormView. The FormHandler would use the information from the FormModel (which describes fields, and the rules/filters applying to theese) to validate the form and decide to either a) display the FormView or b) execute a command, which is provided by the application-programmer. The relationship between FormHandler<->Command may be through inheritance (the programmer would extend FormHandler and implement a hook-method) or through composition (the programmer would pass the Command as a parameter to the FormHandler)