PureMVC AS3 Framework - [Standard Version] | All Packages | All Classes | Index | Frames No Frames |
Class Proxy

Package | org.puremvc.as3.patterns.proxy
Class | public class Proxy
Inheritance | Proxy Notifier
Implements | INotifier, IProxy

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

Public Properties

| Property | Defined by
--- | --- | ---
|  | NAME : String = "Proxy" [static] | Proxy

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined by
--- | --- | ---
|  | data : Object | Proxy
|  | facade : IFacade | Notifier
|  | proxyName : String | Proxy

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | Proxy(proxyName:String = null, data:Object = null) Constructor | Proxy
|  | getData():Object Get the data object | Proxy
|  | getProxyName():String Get the proxy name | Proxy
|  | onRegister():void Called by the Model when the Proxy is registered | Proxy
|  | onRemove():void Called by the Model when the Proxy is removed | Proxy
|  | sendNotification(notificationName:String, body:Object = null, type:String = null):void Create and send an `INotification`. | Notifier
|  | setData(data:Object):void Set the data object | Proxy

Property detail

data | property

`protected var data:Object`

NAME | property |

`public static var NAME:String = "Proxy"`

proxyName | property |

`protected var proxyName:String`
Constructor detail

Proxy | () | constructor

`public function Proxy(proxyName:String = null, data:Object = null)`

Constructor

Parameters

| `proxyName:String` (default = `null`)``
| `data:Object` (default = `null`)``

Method detail

getData | () | method

`public function getData():Object`

Get the data object

Returns

| `Object`

getProxyName | () | method |

`public function getProxyName():String`

Get the proxy name

Returns

| `String`

onRegister | () | method |

`public function onRegister():void`

Called by the Model when the Proxy is registered

onRemove | () | method |

`public function onRemove():void`

Called by the Model when the Proxy is removed

setData | () | method |

`public function setData(data:Object):void`

Set the data object

Parameters

| `data:Object`