From: David Baird Date: Tue, 8 Nov 2005 12:59:30 +0000 (+0000) Subject: Incorporated comments from Kieren into Manual/Terminology.pod X-Git-Tag: 2.11~97 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=18bf82e03623c74badbbcd4a79fa4d9cae4715b0;p=maypole.git Incorporated comments from Kieren into Manual/Terminology.pod git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@421 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Manual/Terminology.pod b/lib/Maypole/Manual/Terminology.pod index 3e9a53a..0ef3581 100644 --- a/lib/Maypole/Manual/Terminology.pod +++ b/lib/Maypole/Manual/Terminology.pod @@ -61,7 +61,11 @@ avoid using this term altogether. =item request -The Maypole request object. +The Maypole request object. This contains all data sent in the request +(including headers, cookies, CGI parameters), and accumulates data to be sent in +the response (headers and content). It also provides access to the configuration +object, and stores the information parsed out of the URL (action, table, args +etc.). Plugins often add methods and further data members to the request object. =item workflow @@ -82,18 +86,21 @@ class. An Exported method. -Note: not the action attribute of a form, although the form's action URI will -generally include a Maypole action component. +Note: this is not the action attribute of a form, although the form's action URI +will generally include a Maypole action component. For instance, a form might +submit to the following URL: C<[% $base %]/beer/drink/5>. The form action is the +URL, whereas the Maypole action is the C method on the C +object with an ID of 5. =item command -In some templates, an C is called a C. +In some of the standard factory templates, an C is called a C. =item template A file used to generate HTML for part or all of a web page. Maypole currently supports Template Toolkit and Mason as templating languages, but others could -be added easily. +be added easily. Of course, a template doesn't have to generate only HTML. =back @@ -111,6 +118,11 @@ Here's one opinion: =over 4 +=item view + +This is represented in Maypole by the view class (L, +L, or L), and by the templates. + =item controller An abstract concept in Maypole, i.e. there is no specific controller class. @@ -122,7 +134,7 @@ practice it works well. More detailed events within the processing of a request are actually handled by methods in the Maypole 'model'. For instance, switching from one template to -another. +another - the "Template Switcheroo" referred to in L. Be aware that occasionally authors refer to the C when they are describing the C. @@ -142,32 +154,32 @@ The distinction is probably unimportant when using Maypole in 'default' mode - i.e. using L, and allowing Maypole to autogenerate the 'model' classes straight out of the database. -However, in many applications, a more complex domain model is required, or may -already exist. In this case, the Maypole model is more clearly seen as a layer -that sits on top of the custom domain model, and controls access to it from -the web UI. In this kind of situation, it seems more helpful to think of the -Maypole model as part of the controller. This conceptualisation helps developers -maintain a separation between the Maypole model classes, and their own domain -model. Without this distinction, developers may add domain-specific code -to the Maypole model classes, ending up with two separate code bases -intermingled within one set of files. - -To a certain extent, this is fine. But if you find yourself adding lots on +However, in many applications, a more complex domain model is required, or may +already exist (see L). In this case, the Maypole +model is more clearly seen as a layer that sits on top of the custom domain +model, and controls access to it from the web UI. In this kind of situation, it +seems more helpful to think of the Maypole model as part of the controller (or +as a Presentation Model - see below). + +This conceptualisation helps developers maintain a separation between the +Maypole model classes, and their own domain model. Without this distinction, +developers may add domain-specific code to the Maypole model classes. To a +certain extent, this is fine. But if you find yourself adding lots of non-Exported methods to your Maypole model classes, and these methods are not -there to support Exported methods, consider whether you could separate out the -domain model into a separate hierarchy of classes that you import into the -Maypole model. See L. +there to directly support Exported methods, consider whether you could separate +out the domain model into a separate hierarchy of classes that you import into +the Maypole model. See L. + +Otherwise, there will be two uncoupled code bases, living in the same files, +interacting through a relatively small number of methods. These methods should +in fact become the public API of the domain model, which should be moved to a +separate class hierarchy. The distinction between the Maypole model, the domain model, and the model in the MVC pattern, is fuzzy and variable. In straightforward Maypole applications, they're all pretty much the same thing. In more advanced applications, they begin to diverge. See C. -=item view - -This is represented in Maypole by the view class (L, -L, or L), and by the templates. - =head3 Presentation Model This pattern seems to more accurately describe the role of the Maypole model.