Dart DocumentationpuremvcProxy

Proxy Class

A base IProxy implementation.

In PureMVC, IProxy implementors assume these responsibilities:

  • Implement a common method which returns the name of the IProxy.
  • Provide methods for setting and getting a Data Object.

Additionally, IProxys typically:

  • Provide methods for manipulating the Data Object and referencing it by type.
  • Generate INotifications when their Data Object changes.
  • Expose their name as a static final String called NAME.
  • Encapsulate interaction with local or remote services used to fetch and persist data.

See IModel

Extends

Notifier > Proxy

Implements

IProxy

Constructors

Code new Proxy(String name, [data]) #

Constructor

  • Param name - the name this IProxy will be registered with.
  • Param data - the Data Object (optional)
Proxy( String this.name, [Dynamic this.data] ){ }

Methods

Code getData() #

Get the dataObject.

  • Returns Dynamic - the dataObject.
Dynamic getData() 
{
    return data;
}

Code String getName() #

Get the [IProxy] [name].

String getName()
{
    return name;
}

Code void onRegister() #

Called by the IModel when the IProxy is registered.

Override in your subclass and add code to be run at registration time.

void onRegister(){}

Code void onRemove() #

Called by the IModel when the IProxy is removed

void onRemove(){}

Code void setData(dataObject) #

Set the dataObject.

  • Param Dynamic - the dataObject this IProxy will tend.
void setData( Dynamic dataObject )
{
   data = dataObject;
}

Fields

Code var data #

This IProxy's dataObject.

Dynamic data;

Code String name #

This IProxy's name.

String name;