Proxies with State
cormac at cs.ucsc.edu
Tue May 31 16:57:28 PDT 2011
One possible concern with proxies is the overhead of separate proxy
and handler objects, and trap methods that likely close over a backing
object. This concern would be exacerbated in the case of value
proxies, where we might want millions of complex number proxies, and
also came up in the discussion of the Observer use case last week.
It seems it would be nice to allow proxy objects to have some state.
Since accesses to the proxy would trap to the handler, we need an
alternative way for the handler to access the proxy state, perhaps
Proxy.untrappedGetOwnPropertyDescriptor(proxy, name), etc.
This might allow us to proxify existing objects to attach an Observer
without introducing much additional, per-object overhead.
More information about the es-discuss