Well, I've been there and done that, and the summary is: don't do it.
It was just too difficult to tailor the individual forms to their specific purposes. Also, this may be nice enough for a very quick first cut at an application, but my experience was that you immediately have to start putting more business logic into the individual forms.
Also, it goes without saying that getting the forms' layouts to look reasonable is a nightmare... You either:
- try to make some super-smart logic for laying out the forms automatically (it won't work that well, in the end).
- limit the form functionality in order to facilitate the automatic layout, thus hamstringing the more important aspects of your application for the less important.
- make it so manipulable and controllable that you haven't really gained anything for your efforts.
But I'm not just saying this to be negative, because I can also tell you what did work for us: Make or find (or find and customize) some good, reusable utility code for these forms (to do all of the commonly repeated tasks). What you get out of this is:
- the actual forms are pretty thin, but contain all of the important logic.
- the forms aren't just data structures, so you can really do anything with them.
- you use the same utility code for complicated application screens (well beyond simple, auto-generatable forms).
- those last two points, together, allow you to evolve simple forms into non-simple forms in an organic way, as requirements shift. Also, you don't have to look at your simple forms and your complicated forms as two different things... much like how a simple script can become a bigger program as the complexity of the task grows. It's like: rather than starting from a shell script and having to recode it halfway through to a java app, you just start in perl, and finish in perl.
Unfortunately, I can't post any sample code for this, because the work I'm referring to was proprietary... but I'm sure there is some similar stuff on CPAN. Anyone else have specific recomendations?
------------
:Wq
Not an editor command: Wq