|
Re: Global "app context" approach: msg#00229web.mason.user
On Sat, 23 Aug 2003, Todd Grimason wrote: > I'm seeking a bit of advice on the best way to approach this before > embarking down the wrong path... > > Basically what I'm looking to do is have a global "context", that has > references to objects such as a logger, a config object, and similar. > > Is the Mason request object (I'm using ..WithApacheSession) the place to > stick these, perhaps by wrapping/subclassing the request object? I wouldn't recommend this approach. What's wrong with something like: MyApp::Context->log->... The logging object can be created at server startup, or just the first itm the log() method is called. > I'd also like access to these object from perl modules - I suppose > passing a context object to constructors would provide this. Another > touch I'd like is to be able to check modification times on an external > config file, to allow reloading without bouncing apache. Or just make the context module's methods class methods, as above. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Internal_redirect, clear_buffer, etc ... not saving session vars?: 00229, Dave Rolsky |
|---|---|
| Next by Date: | Re: Global "app context" approach: 00229, Todd Grimason |
| Previous by Thread: | Global "app context" approachi: 00229, Todd Grimason |
| Next by Thread: | Re: Global "app context" approach: 00229, Todd Grimason |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |