Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 2492 invoked from network); 27 May 2006 12:04:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 May 2006 12:04:48 -0000 Received: (qmail 74446 invoked by uid 500); 27 May 2006 12:04:42 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 74415 invoked by uid 500); 27 May 2006 12:04:42 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 74400 invoked by uid 99); 27 May 2006 12:04:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 May 2006 05:04:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.199.181.93] (HELO faraday.net.versatilia.com) (217.199.181.93) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 May 2006 05:04:38 -0700 Received: from spc2-burn2-0-0-cust689.bagu.broadband.ntl.com ([82.31.110.178] helo=[192.168.87.153]) by faraday.net.versatilia.com with esmtpa (Exim 4.43) id 1FjxaP-0001eJ-O8; Sat, 27 May 2006 13:08:05 +0100 Message-ID: <4478402D.5080904@versatilia.com> Date: Sat, 27 May 2006 13:03:57 +0100 From: John ORourke User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jonathan Vanasco CC: list mod_perl Subject: Re: sharing data within a handler (but not across) References: <9B282E2F-BFB9-4338-B343-CB3A0E758496@2xlp.com> In-Reply-To: <9B282E2F-BFB9-4338-B343-CB3A0E758496@2xlp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Versatilia-MailScanner-Information: See http://www.versatilia.com/mailscanning.html X-Versatilia-MailScanner: Found to be virus free Envelope-From: john@versatilia.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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