[Chicago] Fwd: [Chicago-talk] Updated Meeting Announcement

Ian Bicking ianb at colorstudy.com
Tue Oct 11 18:00:57 CEST 2005


skip at pobox.com wrote:
>     >> Please join the Chicago Perl Mongers for an exciting look at two MVC
>     >> web application frameworks.
> 
> Okay, I'll fess up.  MVC has never made any sense to me, at least in the
> examples I've seen.  I've encountered it over and over again in my
> programming career and for some reason it has just never clicked with me.
> Maybe all the examples I've seen of it have been examples of MVC done badly.
> Pointers to lucid descriptions and examples cheerfully accepted.

MVC in web apps is pretty simple:

* The View is your templates, or general HTML-generating code.
* The Controller is the first thing to respond to requests, generally 
performing actions based on form submissions, and fetching any 
referenced objects.  E.g., when you access /view?article_id=5, the code 
that gets Article 5 is probably controllerish.
* The Model is your code and domain objects that aren't specifically 
related to the web.  It's Article in this case.

MVC design tries to keep these three roles separate.  In GUI code MVC 
can be a little more complicated, as Model isn't "just" all the other 
code, since often the View and Model are directly connected (so the View 
can immediately see updates to the Model).  But since you can't 
immediately see anything in HTTP this is not an issue.


-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Chicago mailing list