NAME

org::puremvc::perl5::core::Model

Singleton responsible for implementing the MVC Model pattern.


DESCRIPTION

In PureMVC, the Model class assumes these responsibilities:

Your application must register Proxy instances with the Model.

Typically, you use a command to create and register Proxy instances once the Facade has initialized the Core actors.


INTERFACE

Methods

getInstance

sub getInstance();

Returns the singleton instance of the Model.

Returns

org::puremvc::perl5::core::Model - The singleton instance of the Model.

initializeModel

sub initializeModel();

Initialize the singleton instance of the Model. This method is automatically called during singleton instantiation. This is where you will achieve your Model subclass specific initializations if your application actually overrides pureMVC Model class.

registerProxy

sub registerProxy( $proxy );

Register a Proxy instance with the Model. During registration proxy's getProxyName method is called by Model singleton to map $proxy instance with its name.

Any registered proxy is afterwards retrieved, removed or checked by its name.

Parameters

retrieveProxy

sub retrieveProxy( $proxy_name );

Retrieve from the Model a proxy registered with name $proxy_name.

Parameters

Returns

org::puremvc::perl5::patterns::proxy::Proxy - The Proxy instance retrieved from the Model.

removeProxy

sub removeProxy( $proxy_name );

Remove from the Model a proxy registered with name $proxy_name.

Parameters

Returns

org::puremvc::perl5::patterns::proxy::Proxy - The Proxy instance removed from the Model.

hasProxy

sub hasProxy( $proxy_name );

Check whether a proxy is registered with name $proxy_name or not.

Parameters

Returns

scalar - 1 if a Proxy instance is registered with the Model with name $proxy_name, "" otherwise.

Properties

_proxies

Array reference on registered Proxies with the Model. You should not have to access it and must not update it in normal usage.


SEE ALSO

org::puremvc::perl5::core::View

org::puremvc::perl5::core::Controller

org::puremvc::perl5::patterns::facade::Facade

org::puremvc::perl5::patterns::observer::Notification

org::puremvc::perl5::patterns::proxy::Proxy

org::puremvc::perl5::patterns::mediator::Mediator

org::puremvc::perl5::patterns::command::SimpleCommand

org::puremvc::perl5::patterns::command::MacroCommand

org::puremvc::perl5::patterns::observer::Notifier

org::puremvc::perl5::patterns::observer::Observer