Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Re: Re: Re: Re: mod_perl & TT2 Architecture

by EvdB (Deacon)
on May 26, 2004 at 07:51 UTC ( #356485=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Re: mod_perl & TT2 Architecture
in thread mod_perl & TT2 Architecture

This debate could go on for ages. Let me say that I do agree with you and am playing devil's advocate to some extent. The point I am trying to make is that in some situations the standard way of doing things is not always the best.

I'll try to get this across by looking only at the first point - that putting the dispatch stuff in the main module can be a good idea for 'blackbox' apps.

The imaginary scenario: I have a blog app which runs under mod_perl. It is intended that the sys admin need only run perl-MCPAN -e 'install UberBlog' and then add this to their httpd.conf file:

<Location /foo/bar/blog/> SetHandler perl-script PerlHandler UberBlog::Dispatcher PerlSetVar UberBlog_DSN "dbi:Pg:dbname:uberblog" </Location>

Even the most novice sys-admin should be able to do that, and would then be able to forget about it as long as it all worked. When it comes to upgrading all she need do is run perl -MCPAN -e 'install UberBlog' again and it will all work.

If the user wants to dig into the internals then the name of the handler should give them a good clue as where to start.

All of the above could have been put into 'uberblog.conf' and then 'Include'd as you suggest, but then this file would have to be located on the filesystem somewhere and it would not be possible to upgrade it when the module got upgraded. This adds complexity that the user does not want. It could also couse real trouble if another admin on the same machine decides to upgrade the modules.

I think that there is merit in putting a fair amount of stuff in the main handler and running the show from there. There is also plenty of merit in not doing that though... I hope have have won you over to some extent with regards to the above scenario.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://356485]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2020-05-31 13:45 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (173 votes). Check out past polls.