[Twisted-Python] Accessing app-wide data in Woven
Christopher Armstrong
radix at twistedmatrix.com
Fri Jul 18 15:05:57 MDT 2003
On Fri, Jul 18, 2003 at 03:58:14PM -0500, Glyph Lefkowitz wrote:
>
> On Friday, July 18, 2003, at 01:28 PM, Donovan Preston wrote:
>
I'm pretty sure that there was a freak double-thinko by both glyph and
dovonan here: s/resource/request/ for the marked instances:
> >This is precisely why I made the resource Componentized. It's far more
^^^^^^^^ make that request
> >convenient and less error-prone to do this than to attempt to make
> >sure that a reference to your Configuration object is passed to every
> >single child in your system.
>
> While I agree that it's better to use a component on the resource than
^^^^^^^^ here too
> to randomly set a junk attribute, I'd also like to caution against
> using this too much. Unless you're doing something like computing
> relative links, it's a lot safer and less surprising to explicitly pass
> references around in your application. This might involve more typing,
> but trying to "throw" objects to other parts of your application, using
> the registry, the Componentized request, or the session makes it
> dependent upon an execution context. That context is often present,
> but it's an undeclared requirement, so it can be a very surprising
> impediment to using a particular kind of resource from some other code
> that does a related but not identical thing.
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://twistedmatrix.com/users/radix.twistd/
More information about the Twisted-Python
mailing list