Package puremvc :: Module interfaces :: Class IController
[hide private]
[frames] | no frames]

Class IController

source code

object --+
         |
        IController
Known Subclasses:

The interface definition for a PureMVC Controller.

In PureMVC, an IController implementor follows the 'Command and Controller' strategy, and assumes these responsibilities:

Remembering which ICommands are intended to handle which INotifications.

Registering itself as an IObserver with the View for each INotification that it has an ICommand mapping for.

Creating a new instance of the proper ICommand to handle a given INotification when notified by the View.

Calling the ICommand's execute method, passing in the INotification.


See Also:
INotification, ICommand
Instance Methods [hide private]
 
registerCommand(self, notificationName, commandClassRef)
Register a particular ICommand class as the handler for a particular INotification.
source code
 
executeCommand(self, notification)
Execute the ICommand previously registered as the handler for INotifications with the given notification name.
source code
 
removeCommand(self, notificationName)
Remove a previously registered ICommand to INotification mapping.
source code
 
hasCommand(self, notificationName)
Check if a Command is registered for a given Notification.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

registerCommand(self, notificationName, commandClassRef)

source code 

Register a particular ICommand class as the handler for a particular INotification.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notificationName - the name of the INotification
  • commandClassRef - the Class of the ICommand

executeCommand(self, notification)

source code 

Execute the ICommand previously registered as the handler for INotifications with the given notification name.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notification - the INotification to execute the associated ICommand for

removeCommand(self, notificationName)

source code 

Remove a previously registered ICommand to INotification mapping.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notificationName - the name of the INotification to remove the ICommand mapping for

hasCommand(self, notificationName)

source code 

Check if a Command is registered for a given Notification.

Raises NotImplemented if subclass does not implement this method.

Parameters:
  • notificationName - the name of the INotification
Returns:
whether a Command is currently registered for the given notificationName.