I'm about to start writing a medium-sized web-based application, which may eventually become much more complex. Although I am quite capable of coding the entire thing from scratch, using the appropriate modules for standard tasks, I thought I might be able to save myself some work, increase maintainability, and better prepare myself for growth by using one of the several CGI frameworks available.
Even after looking at the various nodes comparing/recommending various frameworks (such as Web Application Frameworks and their Templating Engines with a Comparative Study of Template and HTML::Template) and skimming the docs for several of the options mentioned, I have not reached that state of inner peace that is required before I commit to an undertaking. So I thought some more feedback/discussion might help. (Not to mention the fact that the tools available change so quickly that older posts may no longer reflect current reality.)
I hope that not everything that the monks have to say on this matter has been said. So what follows is a combination of the specifications for what I need to accomplish and some exposition about how I would normally do these things. I hope this doesn't get too long:
Since I'm not sure on which servers I will be deploying this, I can't count on having access to mod_perl; so my choices are limited to those frameworks that will work under CGI.
I don't necessarily need an all-in-one solution, but if I have to piece together too much of it myself, I don't know that I'm really doing myself any favors by choosing a framework solution (though I suppose extending an existing solution would be the monk-ish way to solve that problem). :-)
Here are some of the functions I will need, along with My Thoughts or How I Would Probably Do It Myself. These are not absolute rules; I am willing to consider alternative theories, but these notes do reflect some of my current preferences:
Doing It Myself, I would probably just use a dispatch table for the various 'screens' or 'views' the application would be presenting, abstracting as much of the re-usable logic as is useful into a separate module.
I would probably use Apache::Session, and use cookies for storing the session ID, with URL-munging as a fallback.
I would probably parse form data with CGI.pm (just because it would already be installed), even though one of the stripped-down versions (such as CGI::Lite) would probably be a better fit (since I don't use CGI.pm's HTML -generation routines).
Although I could use a module for this, if I were Doing It Myself, I would probably use JavaScript on the client side (for immediate feedback) and stricter validation/taint-checking on the server side using regexes, etc.
I haven't committed to any particular template module at this point.
I normally work with a designer, and in the past I've usually followed these rule for templates:
So typically I've used a template that replaced the <TITLE> tag and filled in a content area with the results of each page. The designer used CSS to modify the look of the various elements in the content area.
I'm hoping that our hallowed monks will be able to help me determine what the best CGI application building tools are for me. Feel free to tell me where my thinking has gone wrong, what I should do instead, as well as how you have or would do it yourself. If you've integrated these features using one or more packages, please share your experiences and opinions. Hopefully this will be as useful to others as I expect it will to me.
In reply to More on Web Application Frameworks by impossiblerobot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |