PureMVC.Core.Model Class Reference

A Singleton IModel implementation. More...

Inheritance diagram for PureMVC.Core.Model:

PureMVC.Interfaces.IModel

List of all members.

Public Member Functions

virtual void RegisterProxy (IProxy proxy)
 Register an IProxy with the Model.
virtual IProxy RetrieveProxy (string proxyName)
 Retrieve an IProxy from the Model.
virtual bool HasProxy (string proxyName)
 Check if a Proxy is registered.
virtual IProxy RemoveProxy (string proxyName)
 Remove an IProxy from the Model.

Protected Member Functions

 Model ()
 Constructs and initializes a new model.
virtual void InitializeModel ()
 Initialize the Singleton Model instance.

Protected Attributes

IDictionary< string, IProxym_proxyMap
 Mapping of proxyNames to IProxy instances.
readonly object m_syncRoot = new object()
 Used for locking.

Static Protected Attributes

static volatile IModel m_instance
 Singleton instance.
static readonly object m_staticSyncRoot = new object()
 Used for locking the instance calls.

Properties

static IModel Instance [get]
 Model Singleton Factory method. This method is thread safe.


Detailed Description

A Singleton IModel implementation.

In PureMVC, the Model class provides access to model objects (Proxies) by named lookup

The Model assumes these responsibilities:

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:
PureMVC.Patterns.Proxy, PureMVC.Interfaces.IProxy


Constructor & Destructor Documentation

PureMVC.Core.Model.Model (  )  [protected]

Constructs and initializes a new model.

This IModel implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton Factory method Model.getInstance()


Member Function Documentation

virtual bool PureMVC.Core.Model.HasProxy ( string  proxyName  )  [virtual]

Check if a Proxy is registered.

Parameters:
proxyName 
Returns:
whether a Proxy is currently registered with the given proxyName.
This method is thread safe and needs to be thread safe in all implementations.

Implements PureMVC.Interfaces.IModel.

virtual void PureMVC.Core.Model.InitializeModel (  )  [protected, virtual]

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

virtual void PureMVC.Core.Model.RegisterProxy ( IProxy  proxy  )  [virtual]

Register an IProxy with the Model.

Parameters:
proxy An IProxy to be held by the Model
This method is thread safe and needs to be thread safe in all implementations.

Implements PureMVC.Interfaces.IModel.

virtual IProxy PureMVC.Core.Model.RemoveProxy ( string  proxyName  )  [virtual]

Remove an IProxy from the Model.

Parameters:
proxyName The name of the IProxy instance to be removed
This method is thread safe and needs to be thread safe in all implementations.

Implements PureMVC.Interfaces.IModel.

virtual IProxy PureMVC.Core.Model.RetrieveProxy ( string  proxyName  )  [virtual]

Retrieve an IProxy from the Model.

Parameters:
proxyName The name of the IProxy to retrieve
Returns:
The IProxy instance previously registered with the given proxyName
This method is thread safe and needs to be thread safe in all implementations.

Implements PureMVC.Interfaces.IModel.


Member Data Documentation

volatile IModel PureMVC.Core.Model.m_instance [static, protected]

Singleton instance.

IDictionary<string, IProxy> PureMVC.Core.Model.m_proxyMap [protected]

Mapping of proxyNames to IProxy instances.

readonly object PureMVC.Core.Model.m_staticSyncRoot = new object() [static, protected]

Used for locking the instance calls.

readonly object PureMVC.Core.Model.m_syncRoot = new object() [protected]

Used for locking.


Property Documentation

IModel PureMVC.Core.Model.Instance [static, get]

Model Singleton Factory method. This method is thread safe.


The documentation for this class was generated from the following file:

Generated on Thu Jan 1 16:26:45 2009 for PureMVC by  doxygen 1.5.8