]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC/Workflow.pod
This is very close to being able to spit out pages now.
[maypole.git] / lib / Apache / MVC / Workflow.pod
index 09031c00da86c2b0da10c19f6c6d5eb519c09676..14a69300069a9531c0f760419f2cba013d266abd 100644 (file)
@@ -20,11 +20,11 @@ Apache::MVC::Workflow - Describes the progress of a request through Apache::MVC
     BeerDB::Beer        $r->call_authenticate
        ->authenticate ------------+------------ $r->authenticate
                                   |
-                           $r->find_objects
-                                  |
                          $r->additional_data
                                   |
                     $r->model_class->process($r)
+                                  |
+                     $r->view_object->process($r)
 
 
 =head1 DESCRIPTION
@@ -76,34 +76,44 @@ preferred format.
 Next, the C<is_applicable> method works out if this is actually
 something that C<Apache::MVC> should care about - whether the class
 exists in the application, whether it supports the given action, and so
-on. This should return an Apache status code; C<OK> if the request
-should proceed, C<DECLINED> if it should be passed on to the default
-handlers, or whatever other codes for permissions problems. 
+on. The action is "supported" if it exists in the model class (or its
+ancestors) and is marked with the C<:Exported> attribute; this stops web
+users from firing off random subroutines in your code.
+
+This should return an Apache status code; C<OK> if the request should
+proceed, C<DECLINED> if it should be passed on to the default handlers,
+or whatever other codes for permissions problems. 
 
 =head2 Are we allowed to do this?
 
 We then look for an appropriate C<authenticate> method to call; first
-it will try Calling the C<authenticate> method of the model class, or,
+it will try calling the C<authenticate> method of the model class, or,
 if that does not exist, the C<authenticate> method on itself. By
 default, this allows access to everyone for everything. Similarly, this
 should return an Apache status code.
 
-=head2 Find the appropriate objects
-
-The C<find_objects> method is called to populate the C<objects> slot of
-the request object with the appropriate objects from the model class. 
-
-This takes the right number of arguments off the C<args> slot by
-examining the attributes of the method in question. Read more about this
-in L<Apache::MVC::Model::Default>.
-
 =head2 Add any additional data to the request
 
 The open-ended C<additional_data> method allows any additional fiddling
 with the request object before it is despatched.
 
-=head2 Ask model to take over
+=head2 Ask model for widget set
+
+Asking the model class to C<process> the current request allows it to do
+any work it needs for the given command, and populate the C<objects> and
+C<template> slots of the request. 
+
+=head2 Ask view to process template
+
+Now the view class has its C<process> method called, finds the
+appropriate templates, passes the C<objects> and any additional data to
+the template, and pushes the output to the web server.
+
+We will go into more detail about these last two phases.
+
+=head1 Model class processing
+
+The model's C<process> method is usually a thin wrapper around the
+action that we have selected.
 
-The C<process> method of the model class is called with the request
-object, and is expected to perform any actions it needs, and then
-despatch control to the view.
+=head2