| Package | org.puremvc.as3.multicore.core |
| Class | public class Model |
| Implements | IModel |
IModel implementation.
In PureMVC, the Model class provides
access to model objects (Proxies) by named lookup.
The Model assumes these responsibilities:
IProxy instances.IProxy instances.
Your application must register IProxy instances
with the Model. Typically, you use an
ICommand to create and register IProxy
instances once the Facade has initialized the Core
actors.
See also
| Property | Defined by | ||
|---|---|---|---|
| instanceMap : Array [static]
| Model | ||
| multitonKey : String | Model | ||
| proxyMap : Array | Model | ||
| Method | Defined by | ||
|---|---|---|---|
|
Model(key:String)
Constructor.
| Model | ||
|
getInstance(key:String):IModel
[static]
Model Multiton Factory method. | Model | ||
|
hasProxy(proxyName:String):Boolean
Check if a Proxy is registered
| Model | ||
|
registerProxy(proxy:IProxy):void
Register an
IProxy with the Model. | Model | ||
|
removeModel(key:String):void
Remove an IModel instance
| Model | ||
|
removeProxy(proxyName:String):IProxy
Remove an
IProxy from the Model. | Model | ||
|
retrieveProxy(proxyName:String):IProxy
Retrieve an
IProxy from the Model. | Model | ||
| Method | Defined by | ||
|---|---|---|---|
|
initializeModel():void
Initialize the
Model instance. | Model | ||
| Constant | Defined by | ||
|---|---|---|---|
| MULTITON_MSG : String = "Model instance for this Multiton key already constructed!" | Model | ||
| instanceMap | property |
protected static var instanceMap:Array
| multitonKey | property |
protected var multitonKey:String
| proxyMap | property |
protected var proxyMap:Array
| Model | () | constructor |
public function Model(key:String)Constructor.
This IModel implementation is a Multiton,
so you should not call the constructor
directly, but instead call the static Multiton
Factory method Model.getInstance( multitonKey )
key:String |
— Error if instance for this Multiton key instance has already been constructed
|
| getInstance | () | method |
public static function getInstance(key:String):IModel
Model Multiton Factory method.
key:String |
IModel —
the instance for this Multiton key
|
| hasProxy | () | method |
public function hasProxy(proxyName:String):BooleanCheck if a Proxy is registered
ParametersproxyName:String |
Boolean — whether a Proxy is currently registered with the given proxyName.
|
| initializeModel | () | method |
protected function initializeModel():void
Initialize the Model instance.
Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.
| registerProxy | () | method |
public function registerProxy(proxy:IProxy):void
Register an IProxy with the Model.
proxy:IProxy — an IProxy to be held by the Model.
|
| removeModel | () | method |
public function removeModel(key:String):voidRemove an IModel instance
Parameterskey:String — of IModel instance to remove
|
| removeProxy | () | method |
public function removeProxy(proxyName:String):IProxy
Remove an IProxy from the Model.
proxyName:String — name of the IProxy instance to be removed.
|
IProxy —
the IProxy that was removed from the Model
|
| retrieveProxy | () | method |
public function retrieveProxy(proxyName:String):IProxy
Retrieve an IProxy from the Model.
proxyName:String |
IProxy —
the IProxy instance previously registered with the given proxyName.
|
| MULTITON_MSG | constant |
protected const MULTITON_MSG:String = "Model instance for this Multiton key already constructed!"