Package puremvc :: Package patterns :: Module proxy :: Class Proxy
[hide private]
[frames] | no frames]

type Proxy

source code

              object --+    
                       |    
interfaces.INotifier --+    
                       |    
       observer.Notifier --+
                           |
       interfaces.IProxy --+
                           |
    interfaces.INotifier --+
                           |
                          Proxy

A base IProxy implementation.

In PureMVC, Proxy classes are used to manage parts of the application's data model.

A Proxy might simply manage a reference to a local data object, in which case interacting with it might involve setting and getting of its data in synchronous fashion.

Proxy classes are also used to encapsulate the application's interaction with remote services to save or retrieve data, in which case, we adopt an asyncronous idiom; setting data (or calling a method) on the Proxy and listening for a Notification to be sent when the Proxy has retrieved the data from the service.


See Also: Model

Instance Methods [hide private]
 
__init__(self, proxyName=None, data=None)
Proxy Constructor
source code
 
getProxyName(self)
Get the Proxy name
source code
 
setData(self, data)
Set the Proxy data
source code
 
getData(self)
Get the proxy data
source code
 
onRegister(self)
Called by the Model when the Proxy is registered
source code
 
onRemove(self)
Called by the Model when the Proxy is removed
source code

Inherited from observer.Notifier: sendNotification

Class Variables [hide private]
  NAME = 'Proxy'
  facade = None
  proxyName = None
  data = None
Method Details [hide private]

__init__(self, proxyName=None, data=None)
(Constructor)

source code 

Proxy Constructor

Parameters:
  • proxyName - the name of the proxy instance (optional)
  • data - the proxy data (optional)
Overrides: observer.Notifier.__init__

getProxyName(self)

source code 

Get the Proxy name

Returns:
the proxy name
Overrides: interfaces.IProxy.getProxyName

setData(self, data)

source code 

Set the Proxy data

Parameters:
  • data - the Proxy data object
Overrides: interfaces.IProxy.setData

getData(self)

source code 

Get the proxy data

Returns:
the Proxy data object
Overrides: interfaces.IProxy.getData

onRegister(self)

source code 

Called by the Model when the Proxy is registered

Overrides: interfaces.IProxy.onRegister

onRemove(self)

source code 

Called by the Model when the Proxy is removed

Overrides: interfaces.IProxy.onRemove