Class Proxy
- Known Subclasses:
-
CompositeBuilder,
EntryProxy
A simple generic Proxy class, forwarding all calls to
subject. So, for the benefit of the python newbie, what does
this really mean? Well, it means that you can take an object, let's
call it 'objA', and wrap it in this Proxy class, with a statement
like this
proxyObj = Proxy(objA),
Then, if in the future, you do something like this
x = proxyObj.var1,
since Proxy does not have a 'var1' attribute (but presumably objA does),
the request actually is equivalent to saying
x = objA.var1
Inherit from this class to create a Proxy.
| Method Summary |
| |
__init__(self,
subject)
Wrap an object as a Proxy object |
| |
__cmp__(self,
other)
|
| |
__getattr__(self,
name)
Retrieve an attribute from the wrapped object. |
| |
get(self)
Retrieve the entire wrapped object |
__init__(self,
subject)
(Constructor)
Wrap an object as a Proxy object
-
|
__getattr__(self,
name)
(Qualification operator)
Retrieve an attribute from the wrapped object. If the named
attribute doesn't exist, AttributeError is raised
-
|
get(self)
Retrieve the entire wrapped object
-
|