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:

The Basics:

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). :-)

The Details:

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:

View Management:

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.

Session Management:

I would probably use Apache::Session, and use cookies for storing the session ID, with URL-munging as a fallback.

CGI Form-handling:

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).

Form Validation:

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.

Templating:

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:

Potential Requirements:

The Request:

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.


Impossible Robot

In reply to More on Web Application Frameworks by impossiblerobot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.