From: Jesse Sheidlower Date: Tue, 31 Jan 2006 03:54:16 +0000 (+0000) Subject: Additions to Manual::About (describing MVC) X-Git-Tag: 5.7099_04~713 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=95bb1e811f5249194cb36d15f4e6f90bae537a10 Additions to Manual::About (describing MVC) --- diff --git a/lib/Catalyst/Manual/About.pod b/lib/Catalyst/Manual/About.pod index 1c30b63..d254662 100644 --- a/lib/Catalyst/Manual/About.pod +++ b/lib/Catalyst/Manual/About.pod @@ -33,11 +33,11 @@ new one. =item * Do something based on a URI -So that C will go to a "view" of -item 23 in your catalog, and C -will display the status of order 7582, and -C will display a form to add -a comment to page 8. +So that C will go to a +"display" of item 23 in your catalog, and +C will display the status of +order 7582, and C will +display a form to add a comment to page 8. =item * Interact with a data store @@ -97,6 +97,107 @@ working programmers. =head2 The MVC pattern +MVC, or Model-View-Controller, is a model currently favored for web +applications. This design pattern is originally from the Smalltalk +programming language. The basic idea is that the three main areas of an +application--handling application flow (Controller), processing +information (Model), and outputting the results (View)--are kept +separate, so that it is possible to change or replace any one without +affecting the others. + +Discussions of MVC often degenerate into nitpicky arguments about the +history of the pattern, and exactly what "usually" or "should" go into +the Controller or the Model. We have no interest in joining such a +debate. In any case, Catalyst does not enforce any particular setup; you +are free to put any sort of code in any part of your application, and +this discussion (and others elsewhere in the Catalyst documentation) is +only a suggestion based on what we think works well. In most Catalyst +applications, each branch of MVC will be made of up of several Perl +modules that can handle different needs in your application. + +The purpose of the B is to access and modify data. Typically +the Model will interact with a relational database, but it's also +common to use other data sources, such as the L search +engine, an LDAP server, etc. + +The purpose of the B is to present data to the user. Typical Views +use a templating module to generate HTML code, using L