PureMVC Framework for Haxe: API Documentation
Back | Index
interface org.puremvc.haxe.interfaces.IController

The interface definition for a PureMVC Controller.

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

- Remembering which `ICommand`s 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`.

function executeCommand(notification : INotification) : Void
  Execute the `ICommand` previously registered as the handler for `INotification`s with the given notification name.
function hasCommand(notificationName : String) : Bool
  Check if a Command is registered for a given Notification
function registerCommand(notificationName : String, commandClassRef : Class<ICommand>) : Void
  Register a particular `ICommand` class as the handler for a particular `INotification`.
function removeCommand(notificationName : String) : Void
  Remove a previously registered `ICommand` to `INotification` mapping.

Back | Index