On Tue, Jan 20, 2009 at 3:49 PM, Tycon <[email protected]> wrote:
>
> empirical data is that if you comment out the "RegistryManager" in
> config/middleware.py, you get much better req/sec (but you cant use
> any of the gloabals...).
>
> In fact, isn't the whole purpose of this registry facility to enable
> request-local objects (such as the "request" object) to be accessed as
> globals (e.g not having to pass them as arguments to the action) ?
>
> So to support a bad programming paradigm (using globals) the solution
> is  to have another inefficient layer to make sure accessing those
> globals doesn't cause any scoping and synchronization issues ??? Why
> not just get rid of the bad paradigm ?

You can already access the context objects as self._py_object.c etc in
the action, which does not use proxies.  And if you haven't had any
problems commenting out the RegistryManager, I guess that's a viable
way to go.

In the interactive traceback:

>>> dir(self._py_object)
['__class__', '__delattr__', '__dict__', '__doc__',
'__getattribute__', '__hash__', '__init__', '__module__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__',
'__weakref__', 'app_globals', 'buffet', 'c', 'cache', 'config', 'g',
'h', 'request', 'response', 'session', 'translator']

>  In Pylons 2 all pertinent
> information about the request would be passed to the user's action
> method as explicit arguments.

I think Pylons users are too attached to the globals to eliminate
them, plus it would break backward compatibility severely.  And if
this combined Pylons/TG/BFG framework gets underway, I don't think
there will be a Pylons 2.  (I did request that the design not include
any StackedObjectProxies, or at least make them optional, so that part
is covered.)

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to