Single PerlResponseHander for Web Application

Jerry Pereira <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CA+AtUcVrLUAAeCEPQTV6YzThBRbpB1URBMmFMoAg8-oAwmz9gQ@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.