/* PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. Your reuse is governed by the Creative Commons Attribution 3.0 United States License */ package org.puremvc.as3.interfaces { /** * 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.

* * @see org.puremvc.as3.interfaces.IModel IModel * @see org.puremvc.as3.interfaces.IView IView * @see org.puremvc.as3.interfaces.IController IController * @see org.puremvc.as3.interfaces.ICommand ICommand * @see org.puremvc.as3.interfaces.INotification INotification */ public interface IFacade extends INotifier { /** * Register an IProxy with the Model by name. * * @param proxy the IProxy to be registered with the Model. */ function registerProxy( proxy:IProxy ) : void; /** * Retrieve a IProxy from the Model by name. * * @param proxyName the name of the IProxy instance to be retrieved. * @return the IProxy previously regisetered by proxyName with the Model. */ function retrieveProxy( proxyName:String ) : IProxy; /** * Remove an IProxy instance from the Model by name. * * @param proxyName the IProxy to remove from the Model. * @return the IProxy that was removed from the Model */ function removeProxy( proxyName:String ) : IProxy; /** * Check if a Proxy is registered * * @param proxyName * @return whether a Proxy is currently registered with the given proxyName. */ function hasProxy( proxyName:String ) : Boolean; /** * Register an ICommand with the Controller. * * @param noteName the name of the INotification to associate the ICommand with. * @param commandClassRef a reference to the Class of the ICommand. */ function registerCommand( noteName : String, commandClassRef : Class ) : void; /** * Remove a previously registered ICommand to INotification mapping from the Controller. * * @param notificationName the name of the INotification to remove the ICommand mapping for */ function removeCommand( notificationName:String ): void; /** * Check if a Command is registered for a given Notification * * @param notificationName * @return whether a Command is currently registered for the given notificationName. */ function hasCommand( notificationName:String ) : Boolean; /** * Register an IMediator instance with the View. * * @param mediator a reference to the IMediator instance */ function registerMediator( mediator:IMediator ) : void; /** * Retrieve an IMediator instance from the View. * * @param mediatorName the name of the IMediator instance to retrievve * @return the IMediator previously registered with the given mediatorName. */ function retrieveMediator( mediatorName:String ) : IMediator; /** * Remove a IMediator instance from the View. * * @param mediatorName name of the IMediator instance to be removed. * @return the IMediator instance previously registered with the given mediatorName. */ function removeMediator( mediatorName:String ) : IMediator; /** * Check if a Mediator is registered or not * * @param mediatorName * @return whether a Mediator is registered with the given mediatorName. */ function hasMediator( mediatorName:String ) : Boolean; /** * 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.

* * @param notification the INotification to notify IObservers of. */ function notifyObservers( note:INotification ) : void; } }