type Model
source code
object --+
|
interfaces.IModel --+
|
Model
A Singleton IModel
implementation.
In PureMVC, the Model
class provides access to model
objects (Proxies) by named lookup.
The Model
assumes these responsibilities:
Maintain a cache of IProxy
instances.
Provide methods for registering, retrieving, and removing
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.
|
__new__(cls,
*args,
**kwargs)
This IModel implementation is a Singleton, so you should
not call the constructor directly, but instead call the static
Singleton method Model.getInstance() |
source code
|
|
|
|
|
instance = None
|
|
proxyMap = None
|
__new__(cls,
*args,
**kwargs)
Static Method
| source code
|
This IModel implementation is a Singleton, so you should
not call the constructor directly, but instead call the static Singleton
method Model.getInstance()
- Overrides:
object.__new__
|
Model Singleton Static method.
- Returns:
- the Singleton instance of
Model
|
Initialize the Singleton Model instance.
Called automatically by the constructor.
|
Retrieve an IProxy from the Model .
- Parameters:
proxyName - the name of the IProxy
- Returns:
- the
IProxy instance previously registered with the
given proxyName .
- Overrides:
interfaces.IModel.retrieveProxy
|
Check if a Proxy is registered
- Parameters:
proxyName - the name of the IProxy
- Returns:
- whether a Proxy is currently registered with the given
proxyName .
- Overrides:
interfaces.IModel.hasProxy
|
Remove an IProxy from the Model .
- Parameters:
proxyName - name of the IProxy instance to be removed.
- Returns:
- the
IProxy that was removed from the
Model
- Overrides:
interfaces.IModel.removeProxy
|