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

The interface definition for a PureMVC Facade.

The Facade Pattern suggests providing a single class to act as a central point of communication for a subsystem.

In PureMVC, the Facade acts as an interface between the core MVC actors (Model, View, Controller) and the rest of your application.

function hasCommand(notificationName : String) : Bool
  Check if a `Command` is registered for a given Notification
function hasMediator(mediatorName : String) : Bool
  Check if a `Mediator` is registered or not
function hasProxy(proxyName : String) : Bool
  Check if a `Proxy` is registered
function notifyObservers(note : INotification) : Void

  Notify the `IObservers` for a particular `INotification`.

  All previously attached `IObservers` for this `INotification`'s list are notified and are passed a reference to the `INotification` in the order in which they were registered.

  NOTE: Use this method only if you are sending custom Notifications. Otherwise use the sendNotification method which does not require you to create the Notification instance.

function registerCommand(noteName : String, commandClassRef : Class<ICommand>) : Void
  Register an `ICommand` with the `Controller`.
function registerMediator(mediator : IMediator) : Void
  Register an `IMediator` instance with the `View`.
function registerProxy(proxy : IProxy) : Void
  Register an `IProxy` with the `Model` by name.
function removeCommand(notificationName : String) : Void
  Remove a previously registered `ICommand` to `INotification` mapping from the Controller.
function removeMediator(mediatorName : String) : IMediator
  Remove a `IMediator` instance from the `View`.
function removeProxy(proxyName : String) : IProxy
  Remove an `IProxy` instance from the `Model` by name.
function retrieveMediator(mediatorName : String) : IMediator
  Retrieve an `IMediator` instance from the `View`.
function retrieveProxy(proxyName : String) : IProxy
  Retrieve a `IProxy` from the `Model` by name.
function sendNotification(notificationName : String, ?body : Dynamic, ?type : String) : Void
  Create and send an `INotification`.

Back | Index