X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FManual%2FInheritance.pod;h=76d76115626194e1f271cecb134edb02e33d1896;hb=ce828f4b7309670fc8b0ed826fd2455c4d5412bb;hp=bff339db3bd467b82f5cf6c59d90c3df1c573026;hpb=93f6780e2cd84eb4f9f6cfc578f42484bb2cf34b;p=maypole.git diff --git a/lib/Maypole/Manual/Inheritance.pod b/lib/Maypole/Manual/Inheritance.pod index bff339d..76d7611 100644 --- a/lib/Maypole/Manual/Inheritance.pod +++ b/lib/Maypole/Manual/Inheritance.pod @@ -33,8 +33,8 @@ application. =head1 Structure of a standard Maypole application A minimal Maypole application (such as the Beer database example from the -L synopsis) consists of a custom driver class (BeerDB.pm), a set of -auto-generated model classes, and a view class: +L synopsis) consists of a custom driver (or controller) class (BeerDB.pm), +a set of auto-generated model classes, and a view class: THE DRIVER @@ -76,6 +76,11 @@ auto-generated model classes, and a view class: pub(); BeerDB::Style beer(); beers(); +=head2 Ouch, that's a lot of inheritence! + +Yes, that's a lot of inheritence, fortunately as of 2.12 Maypole uses +L to ensure sane method resolution. + =head2 What about Maypole::Application - loading plugins The main job of L is to insert the plugins into the @@ -107,7 +112,7 @@ L identifies the appropriate L subclass and inserts it into each of these table classes' C<@ISA> ( C<< Class::DBI:: >> in the diagrams).. -Next, C B L onto the C<@ISA> +Next, C B L onto the C<@ISA> array of each of these classes. Finally, the relationships among these tables are set up. Either do this @@ -184,7 +189,7 @@ C, you would write: 1; From Maypole 2.11, this package will be loaded automatically during C, -and C is B onto it's C<@ISA>. +and C is B onto it's C<@ISA>. Configure relationships either in the individual C classes, or else all together in C itself i.e. not in the Maypole model. This @@ -230,12 +235,14 @@ The resulting model looks like this: =head3 Features +*REWRITE BASED ON C3 and push instead of shift* + 1. Non-Maypole applications using the Offline model are completely isolated from the Maypole application, and need not know it exists at all. 2. Methods defined in the Maypole table classes, override methods defined in the -Offline table classes, because C was unshifted onto the -beginning of each Maypole table class's C<@ISA>. Perl's depth first, +Offline table classes, because C was pushed onto the +end of each Maypole table class's C<@ISA>. Perl's depth first, left-to-right method lookup from e.g. C starts in C, then C, C, C, and C, before moving on to