Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: CGI From Templates

by dash2 (Hermit)
on Jul 10, 2003 at 22:02 UTC ( #273164=note: print w/replies, xml ) Need Help??

in reply to CGI From Templates

I think it's an excellent idea. I had similar thoughts myself, congrats for doing it. Don't know about Form::Magick at all.

For extending your system: I'd avoid inheritance. Split your system up into the core functionality (the autoform parsing from a template) and some surrounding modules that use this. For example, one module could get the parsed form and enter default values from somewhere (e.g. a database). Another module could look at the possible form inputs and autocreate an appropriate database table in a Alzabo-ish kind of way. Another one could create a plain HTML report with some values from somewhere.

If you enforce this separation in your own code, it'll be easy for other people to create new modules like what you've got. You could provide some base classes for simplicity:

FormParser (the core)
FormParser::SubmittedHandler (class to handle submitted data, basically matches up the HTTP POST data with the FormParser structure)
FormParser::CreateReport (abstract base class: talks to FP::SH and creates some kind of static report based on the data and the HTML presentation of the form)
FormParser::SaveData (abstract base class: talks to FP::SH and saves the data in some way. Could also provide methods for a FormParser object to get the data back)

Now I'll take a completely different tack. Don't worry about all this clever stuff, just do something that works. Psychologically you'll be happier and you can then see how to extend it, make it cleverer etc. Especially if people are using your original.
A massive flamewar beneath your chosen depth has not been shown here

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://273164]
[Corion]: Whee! Germanys Grand Central Airport (for Berlin, re-scheduled for the thrid or fourth time, to open now in 2018) has just fired their technical lead
[ambrus]: Corion: Is their budget estimate four times the initial estimate yet? Was the construction late by six months already three months after they started?
[marto]: I'll believe it when I see it. That's been due for many years now :P
[marto]: oddly the last time I was there I saw a zeppelin in flight for the first time
[Corion]: ambrus: I don't know how far the budget estimate has been overrun yet
[Corion]: marto: Heh ;) No, you were likely at Tegel or Schönefeld, the new one ("BER") will be somewhat outside of Berlin ;)
[marto]: Corion Schoenfeld, but my friend has been telling me about this new airport for about 7-8 years now :P
[marto]: I doubt it even exists as a building site :P

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-02-23 11:56 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (346 votes). Check out past polls.