Hi,

I am new to mod_perl and  would like to get some suggestion on my current
application design.

Following is the design:

Single PerlResponseHandler for my application, all requests will be
submitted to this handler, the handler will then dispatch the request to
appropriate sub-handlers based on the URI path.
Note: My path and handler mapping will be stored in a configuration file.

My configuration will look as follows -

<Location /app>
    SetHandler modperl
    PerlResponseHandler MyPackage::MyHandler
    PerlAuthenHandler MyPackage::MyAuthHandler
</Location>


Psudocode in MyPackage::MyHandler:

------------------------------------

sub handler {
    .....
    .....

    //Get the handler based on path
    $sub_handler = getHandler($uripath) //e.g. /app/users
    $sub_handler->handle($r, $session);
}

Please let me know of your views. I am not planning to use Catalyst or
existing frameworks as of now. I also thought of using Apache2::Dispatch,
but i believe it requires that each path has its own handler configured in
httpd.conf file (please correct me if I am wrong)

Thanks,
Jerry

Reply via email to