A Singleton IController
implementation.
In PureMVC, the Controller
class follows the
'Command and Controller' strategy, and assumes these responsibilities:
ICommand
s are intended to handle which INotifications
.IObserver
with the View
for each INotification
that it has an ICommand
mapping for.ICommand
to handle a given INotification
when notified by the View
.ICommand
's execute
method, passing in the INotification
.Your application must register ICommands
with the Controller.
The simplest way is to subclass Facade
,
and use its initializeController
method to add your registrations.
ICommand
has previously been registered
to handle a the given INotification
, then it is executed.
Register a particular ICommand
class as the handler for a particular INotification
.
If an ICommand
has already been registered to
handle INotification
s with this name, it is no longer
used, the new ICommand
is used instead.
The Observer for the new ICommand is only created if this the first time an ICommand has been regisered for this Notification name.
ICommand
to INotification
mapping.
Controller
Singleton Factory method.