]> git.decadent.org.uk Git - maypole.git/commitdiff
Added a description of Presentation Model to Manual/Terminology.pod
authorDavid Baird <cpan.zerofive@googlemail.com>
Tue, 8 Nov 2005 12:24:59 +0000 (12:24 +0000)
committerDavid Baird <cpan.zerofive@googlemail.com>
Tue, 8 Nov 2005 12:24:59 +0000 (12:24 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@420 48953598-375a-da11-a14b-00016c27c3ee

lib/Maypole.pm
lib/Maypole/Manual/Terminology.pod

index b84360cc0262e9e4e77dc6ebf41b05f8d876fccc..8fead4d2a16ffad298370e5c63130eb05ec6753f 100644 (file)
@@ -210,7 +210,7 @@ __PACKAGE__->init_done(0);
 
 As a framework, Maypole provides a number of B<hooks> - methods that are
 intended to be overridden. Some of these methods come with useful default
-behaviour, others do nothing by default. Likely hooks include:
+behaviour, others do nothing by default. Hooks include:
 
     Class methods
     -------------
index 1871910c3b232cb4e60493b314881d878de744ac..3e9a53ac0f64b0066d342f684298d1b9cc38f1c8 100644 (file)
@@ -30,9 +30,9 @@ Maypole.
 \r
 =item application\r
 \r
-Sometimes this is used to refer to the driver, but this term is best reserved \r
-to refer to the complete application, i.e. driver, plugins, templates, model, \r
-the whole shebang.\r
+Sometimes this is used to refer to the driver, or the driver plus configuration\r
+data, but this term is best reserved to refer to the complete application, i.e.\r
+driver, plugins, templates, model, config, the whole shebang.\r
 \r
 =item frontend\r
 \r
@@ -99,9 +99,7 @@ be added easily.
 \r
 =head2 MVC and Maypole\r
 \r
-=over 4\r
-\r
-=item MVC - Model-View-Controller\r
+=head3 MVC - Model-View-Controller\r
 \r
 A pattern describing separation of concerns in a complex application. The \r
 C<model> represents the domain or business logic. The C<view> represents the \r
@@ -111,6 +109,8 @@ Opinions vary between how closely Maypole adheres to this pattern.
 \r
 Here's one opinion:\r
 \r
+=over 4 \r
+\r
 =item controller\r
 \r
 An abstract concept in Maypole, i.e. there is no specific controller class. \r
@@ -152,22 +152,36 @@ model. Without this distinction, developers may add domain-specific code
 to the Maypole model classes, ending up with two separate code bases \r
 intermingled within one set of files. \r
 \r
-To a certain extent, this is fine. But if you find yourself adding lots on \r
-non-Exported methods to your Maypole model classes, \r
-and these methods are not there to support Exported methods, consider whether \r
-you could separate out the domain model into a separate hierarchy of classes \r
-that you import into the Maypole model. \r
+To a certain extent, this is fine. But if you find yourself adding lots on\r
+non-Exported methods to your Maypole model classes, and these methods are not\r
+there to support Exported methods, consider whether you could separate out the\r
+domain model into a separate hierarchy of classes that you import into the\r
+Maypole model. See L<Maypole::Manual::Inheritance>.\r
 \r
 The distinction between the Maypole model, the domain model, and the model in \r
 the MVC pattern, is fuzzy and variable. In straightforward Maypole applications, \r
 they're all pretty much the same thing. In more advanced applications, they \r
-begin to diverge. Take care out there. \r
+begin to diverge. See C<Presentation Model>.  \r
 \r
 =item view\r
 \r
 This is represented in Maypole by the view class (L<Maypole::View::TT>, \r
 L<Maypole::View::Mason>, or L<MasonX::Maypole::View>), and by the templates. \r
 \r
+=head3 Presentation Model\r
+\r
+This pattern seems to more accurately describe the role of the Maypole model.\r
+Martin Fowler describes I<Presentation Model> in L<Separting presentation logic\r
+from the View|http://www.martinfowler.com/eaaDev/OrganizingPresentations.html>\r
+and L<Presentation\r
+Model|http://www.martinfowler.com/eaaDev/PresentationModel.html>.\r
+\r
+The View sends events (e.g. an HTTP request that triggers an Exported method) to\r
+the Presentation Model. This layer responds by interacting with the underlying\r
+domain model, and stores the results in a bunch of variables, which represent\r
+the new state of the View. The View then queries the Presentation Model to\r
+retrieve these new values. In Maypole, this is the role of the C<vars()> method \r
+on L<Maypole::View::Base>, which transmits the new values to the templates. \r
 \r
 =back\r
 \r