Model of OO Perl Classes

Model is simply a set of OO Perl Classes whose methods get exposed to the client through URIs.

Base Model Class

You should implement one base Model class which derives from Apache::PageKit::Model. You must specify the class in the model_base_class option.

In this class, you should implement the PageKit Extensions, and any methods that are common across your Derived Model Classes.

Derived Model Class

The Derived Model Classes derive from your Base Model Class, and should contain methods for the dynamic pages on your site. You must specify the prefix of these classes in the model_dispatch_prefix option of Config/Config.xml.

Inheritance Hierarchy

This figure illustrations how model classes derive from each other and the level of specialization of each class.

              |         Apache::PageKit::Model        |                Common
              | Model code that provides an interface |       <------- across
              | to PageKit and is common to all sites |                all sites
              |           MyPageKit::Common           |                Specialized
              | Model code that is particular to the  |       <------- For Site, common
              | site, but common across all pages     |                across site
                      /           |           \
  +----------------------------+     +----------------------------+
  | MyPageKit::YourClass1      |     | MyPageKit::YourClassN      |    Specialized
  | Model code that is for a   | ... | Model code that is for a   | <- for set of
  | group of pages on the site |     | group of pages on the site |    Pages on site
  +----------------------------+     +----------------------------+