[Pdx-pm] Re: MVC Design Pattern [Was] Software development and The Rules
jkeroes at eli.net
Wed Sep 25 15:15:10 CDT 2002
> > If you really want to learn about this patten, I'd suggest searching
> > for "Model View Controller" on google, and reading some SmallTalk
> > introduction on the matter. Almost all of SmallTalk is MVC-oriented.
> Well, I used the MVC model in Java a lot in school, but applying it to perl
> is the crux of the biscuit, as it were. Especially in a cgi scenario,
> where it's really tempting to put everything in one file. Grr.
Take a look at CGI::Application, that's what we've been turning to lately.
It's not an MVC, it's a State Machine. The nice thing about using
CGI::Application is that you subclass it. Being able to turn your CGIs
into objects makes them... testable! Yay, testing. Oh, and you can also
plug it into Mason or mod_perl if you're interested in that sort of thing.
CGI::Application has hooks for HTML::Template, so you can make your
subclass a combination Controller/View and the template file the Model.
Given the plethora of HTML templating modules on CPAN, we can infer that
this is a fairly common solution to the CGI data-abstraction problem.
It really depends how complex you wish to make the project. I've found
that it's not necessary to separate the View from the Controller for smallish
More information about the Pdx-pm-list