X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FInheritance.pod;h=a20740578a0cde8813474e368439245200592354;hb=ad24ffc85f25a9b73a28cd326c3b3caea234adbf;hp=1c2fca93837bf4241cd341d1660fd0d2146a2dec;hpb=672f0445d8c46ff29b0c6ebf18d30791c017260a;p=maypole.git diff --git a/lib/Maypole/Manual/Inheritance.pod b/lib/Maypole/Manual/Inheritance.pod index 1c2fca9..a207405 100644 --- a/lib/Maypole/Manual/Inheritance.pod +++ b/lib/Maypole/Manual/Inheritance.pod @@ -16,8 +16,7 @@ application. + | - +-- --+ - | + +- -+ | + @@ -37,22 +36,23 @@ A minimal Maypole application (such as the Beer database) consists of a custom driver class (BeerDB.pm), a set of auto-generated model classes, and a view class: + THE DRIVER +------- init() is a factory method, 1 Maypole | it sets up the view Maypole::Config <----- config(); | classes model(); init(); *-------+ THE VIEW - | view_object(); -------+ + | view_object(); -------+ | +--------------* setup(); | Maypole::View::Base | | + | + | | | | 1 | - | | Apache::MVC *-----+ +-----> Maypole::View::TT - | | + | (or another view class) - | | | | - | | PLUGINS | - | | + | - | | | +----- or CGI::Maypole - | | BeerDB or MasonX:::Maypole + | | PLUGINS Apache::MVC *-----+ +-----> Maypole::View::TT + | | + + | (or another view class) + | | | | | + | | +-----+-----+ | + | | | | + | | BeerDB +----- or CGI::Maypole + | | or MasonX:::Maypole | | | setup() is a factory method, | it sets up the model @@ -62,10 +62,10 @@ view class: | | Maypole::Model::Base Class::DBI | + + - | | | - +-------> Maypole::Model::CDBI - + - | + | | | + +-------> Maypole::Model::CDBI + + + | +------------+--------+-------+---------+ | | | | | BeerDB::Pub | BeerDB::Beer | BeerDB::Brewery @@ -76,24 +76,20 @@ view class: pub(); BeerDB::Style beer(); beers(); - =head2 What about Maypole::Application - loading plugins -The main job of L is to insert the plugins into the -hierarchy. It ensures that L inherits from the first plugin, which -inherits from the next, etc., until the last plugin inherits from the frontend. - -It is also the responsibility of L to decide which -frontend to use. +The main job of L is to insert the plugins into the +hierarchy. It is also the responsibility of L to decide +which frontend to use. It builds the list of plugins, then pushes them onto the +driver's C<@ISA>, then pushes the frontend onto the end of the driver's C<@ISA>. +So method lookup first searches all the plugins, before searching the frontend +and finally L itself. From Maypole 2.11, L makes no appearance in the inheritance structure of a Maypole application. (In prior versions, L would make itself inherit the plugins, and then insert itself in the hierarchy, but this was unnecessary). -The order of inheritance is the same as the order in which plugins are supplied -in the C statement. - =head2 Who builds the model? First, remember we are talking about the standard, unmodified Maypole here.