I don't think that's quite right. In both cases, the logic flow is
- Receive a request from the browser
- Decide what do do about it
- Tell the browser to enter a new state
- Wait for the next request from the browser
The difference is in the nature of (1) and the details of (2). I prefer to think about it this way:
- C::A wants to know where you want to go, and decides based on that and the data provided where you actually end up.
- C::P wants to know where you were and decides based on the data provided where you actually go next.
For me, apart from style preferences, C::P works well where the validity conditions for entering particular states frequently depend on the current state. C::A is useful where the validity conditions for entering a particular state depend solely on the data requirements of the target state.
If a C::A app always required a parameter for "current state" along with the "run mode" and used that plus other submissions to determine the state entered, it would provide the same functionality as C::P. C::P just enforces that kind of thinking from the beginning.
-xdg
Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.