I generally take the approach that each run mode should do one thing. How you determine the granularity of the 'one thing' is up to you, but by and large I tend to define my 'one thing' is 'what do i need to do to get the user to the next screen?'. So, most of any given run mode I code is geared towards retrieving/manipulating/authenticating data to feed to the template i want to serve to the user. And unless the user is doing the same exact action again (not the next 'bit' of the same action), they won't be revisiting that run mode.

That said, I do at times go one step further, particularly for important forms. I'll dedicate a run mode just for the processing of the submitted data, and then send the user an HTTP redirect to the next mode. This is so that the user doesn't accidentally resubmit the same data with a refresh when they're on the next page.


In reply to Re: Question about designing a web app using CGI::Application by AidanLee
in thread Question about designing a web app using CGI::Application by disciple

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.