| Package | org.puremvc.as3.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
| Method | Defined by | ||
|---|---|---|---|
|
Model()
Constructor.
| Model | ||
|
[static]
Model Singleton 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 | ||
|
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 Singleton
Model instance. | Model | ||
| Constant | Defined by | ||
|---|---|---|---|
| SINGLETON_MSG : String = "Model Singleton already constructed!" | Model | ||
| instance | property |
protected static var instance:IModel
| proxyMap | property |
protected var proxyMap:Array
| Model | () | constructor |
public function Model()Constructor.
This IModel implementation is a Singleton,
so you should not call the constructor
directly, but instead call the static Singleton
Factory method Model.getInstance()
— Error if Singleton instance has already been constructed
|
| getInstance | () | method |
public static function getInstance():IModel
Model Singleton Factory method.
IModel —
the Singleton instance
|
| 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 Singleton 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.
|
| 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.
|
| SINGLETON_MSG | constant |
protected const SINGLETON_MSG:String = "Model Singleton already constructed!"