On Sun, 18 Aug 2002, Jonathan Lonsdale wrote: > Here's a few approaches I thought of:
In a previous life[1] I made a system that was configured like <perl> my $site1 = new Foo::Site(site => 'www.example.com'); $site1->register_handler( new Foo::ImageHandler(path => '/images/', format => 'png'); ); $site1->register_handler( new Foo::SomeOtherHandler(...); ); ... </perl> <VirtualHost> ... PerlHandler $site1->take_request </VirtualHost> (it wasn't quite like that; the site configurations were all in Perl modules dynamically utilizing perl_sections to configure Apache). When running register_handler, the Foo::Site object would call some method on the Handler object to figure out which namespace or which requests it wanted to handle. During take_request it would then just dispatch the right handler. This made it really easy to activate a subsystems when the customer needed them. The system also made it easy to customize the handlers for each customer. (Just inherit the base Foo::BarHandler into Customer::BarHandler and add the extra magic). - ask [1] okay, not quite a previous life; but it is more than 4 years ago. :-) -- ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();