perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John ORourke <j...@versatilia.com>
Subject Re: sharing data within a handler (but not across)
Date Sat, 27 May 2006 12:03:57 GMT
Jonathan Vanasco wrote:

>   i specifically wanted to keep apache  related stuff out of the model 
> when designing it, but i was in the  situation where i needed to 
> access it for a quick hack ( i chose the  longer elegant solution that 
> negated touching it ) and said "hm... i  wonder how could i do this"

It really hard work - I built a framework which used one instance of its 
main module per Apache instance, and the handler would then call methods 
on it (so it could implement caching and so on).  The following were big 
issues:

 - a file upload module which of course needed access to the 
Apache2::Upload object
 - several modules which create URLs needed document_root and other 
request info
 - cleanup - each module in my framework needs to refer to the main 
object and so stores a reference to it, but this makes garbage 
collection nearly impossible.  I've seen a solution to this in the 
SOAP::Lite modules but haven't had time to find out how it works - I had 
to get very intimate with the Apache2::SOAP source to talk to a .NET 
SOAP client.

As an ex assembler programmer I try not to use abstraction for 
abstraction's sake, so decided that my framework would only have to work 
with Apache2/MP2 or stand-alone.  Made life lots easier.

I also asked myself afterwards why we keep reinventing the wheel!

John


Mime
View raw message