“No Silver Bullet”

Wednesday, 12 Apr 2006

Andy Wardley:

MVC is designed to solve the problem of simultaneously having multiple control entry points, and multiple display outputs, and it achieves 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 predictable. […] 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.