Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Aristotle (5147)


Blah blah blah blah blah []

Journal of Aristotle (5147)

Wednesday April 12, 2006
01:38 AM

“No Silver Bullet”

[ #29291 ]

Andy Wardley :

MVC is designed to solve the problem of simultaneously having multiple control entry points, and multiple display outputs, and it acheives that very elegantly. But web applications only ever have one entry point and one output point – the request and the response. You don’t have multiple simultaneous controls or views to worry about, so there’s little point applying traditional MVC to solve this non-existant problem. Your application, be it a CGI script, mod_perl handler, or even an all-in-one embedded Perl template, receives one and only one request for any one invocation, and it must generate one and only one response. Flow of control is linear and predicatable. […] MVC is (mostly) designed to solve problems that web applications generally don’t have. Clearly separating inputs and outputs from the core parts of an application is clearly beneficial, but MVC is by no means the be-all and end-all of design patterns for web programming.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I'm not an MVC fanboy. In fact, I've never used it in my life, for anything. But I question the assertion that web applications do not have multiple entry points. An enormous number of the web applications I've written all carry a parameter that basically functions as a selector between a number of different functions. If I understand correctly, this is what CGI::Application was written to simplify, although I've never used that either. In fact, such applications may resemble a traditional GUI app, wit

    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • That is indeed the part about web apps which is closest to traditional MVC.

      However, once you have dispatched to a particular part of the application based on the parameter (or a path), there is only exactly one part of the application which can affect the model, and there is only exactly one output that is returned as the response.

      And even the dispatching part is much more straightforward with web apps.

      The main value proposition of MVC is that any controller can change the model at any point and the m

      • I read it, and it was good reading, although I'm sure if I'd actually done any MVC work it'd mean more to me.

        I wasn't trying to identify a fundamental flaw with his comments; just saying that I wasn't entirely sure his appraisal of the situation was correct. But your comments helped clear that up.

        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers