X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=doc%2FAbout.pod;h=3600a9476dcc01e3db038fd04ebff6fc3ea2c1dd;hb=193575767582376e4a70c5d4af176dab84b2b0ee;hp=074f4bc1a223810e197a26c4a5447b7c5ba4b4ed;hpb=43d50fc6cf12e98c44f485eea46ac35637dcce06;p=maypole.git diff --git a/doc/About.pod b/doc/About.pod index 074f4bc..3600a94 100644 --- a/doc/About.pod +++ b/doc/About.pod @@ -257,8 +257,56 @@ of this manual will be about how to do that. In order to do that, we need to look at what Maypole's actually doing. -As mentioned, Maypole is XXX - -=head2 The model class - -=head2 The view class +As mentioned, Maypole is responsible for turning a URL into an object, a +method call, and some templated output. Here's a handy diagram to +explain how it does that: + +=for html + + +Maypole's process revolves around the concept of the Maypole request +object. This is a little like Apache's request object, but at a much +higher level - in fact, in C-based Maypole front-ends, the +Apache request object is incorporated in the Maypole request object. All +that Maypole does is gradually flesh out this object until it contains +something in the C member, and then it is dispatched back to the +front-end for output. + +So to start with, we take the Apache request (or CGI object, or other +way of isolating what's going on) and break it down. For instance, we +turn the URL C into + + { + table => "beer", + action => "view", + args => [ 1 ] + } + +Then Maypole will check that C is a real table, and find the class +that models it. It also checks whether or not we're allowed to call the +C method over the network: + + { + table => "beer", + action => "view", + args => [ 1 ], + model_class => "BeerDB::Beer" + } + +Then there's a user-defined authentication method, which by default just +lets us do anything. Now we hand over to the model class, which loads up +the object, and decides what template we want to use: + + { + table => "beer", + action => "view", + args => [ ], + objects => [ BeerDB::Beer->retrieve(1) ], + model_class => "BeerDB::Beer", + template => "view" + } + +Then it calls Cview>, passing in the request object +as a parameter, and passes the whole lot to the view class for templating. +In the next two chapters, we'll look at how Maypole's default model and +view classes generally do what you want them to do.