Interface IFacade

All Superinterfaces:
INotifier
All Known Implementing Classes:
Facade

public interface IFacade
extends INotifier

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 Also:
IModel, IView, IController, ICommand, INotification
  • Method Summary

    Modifier and Type Method Description
    boolean hasCommand​(java.lang.String notificationName)
    Check if a Command is registered for a given Notification
    boolean hasMediator​(java.lang.String mediatorName)
    Check if a Mediator is registered or not
    boolean hasProxy​(java.lang.String proxyName)
    Check if a Proxy is registered
    void notifyObservers​(INotification notification)
    Notify the IObservers for a particular INotification.
    void registerCommand​(java.lang.String notificationName, java.util.function.Supplier<ICommand> commandSupplier)
    Register an ICommand with the Controller.
    void registerMediator​(IMediator mediator)
    Register an IMediator instance with the View.
    void registerProxy​(IProxy proxy)
    Register an IProxy with the Model by name.
    void removeCommand​(java.lang.String notificationName)
    Remove a previously registered ICommand to INotification mapping from the Controller.
    IMediator removeMediator​(java.lang.String mediatorName)
    Remove a IMediator instance from the View.
    IProxy removeProxy​(java.lang.String proxyName)
    Remove an IProxy instance from the Model by name.
    IMediator retrieveMediator​(java.lang.String mediatorName)
    Retrieve an IMediator instance from the View.
    IProxy retrieveProxy​(java.lang.String proxyName)
    Retrieve a IProxy from the Model by name.

    Methods inherited from interface org.puremvc.java.interfaces.INotifier

    sendNotification, sendNotification, sendNotification
  • Method Details

    • registerProxy

      void registerProxy​(IProxy proxy)

      Register an IProxy with the Model by name.

      Parameters:
      proxy - the IProxy to be registered with the Model.
    • retrieveProxy

      IProxy retrieveProxy​(java.lang.String proxyName)

      Retrieve a IProxy from the Model by name.

      Parameters:
      proxyName - the name of the IProxy instance to be retrieved.
      Returns:
      the IProxy previously regisetered by proxyName with the Model.
    • removeProxy

      IProxy removeProxy​(java.lang.String proxyName)

      Remove an IProxy instance from the Model by name.

      Parameters:
      proxyName - the IProxy to remove from the Model.
      Returns:
      the IProxy that was removed from the Model
    • hasProxy

      boolean hasProxy​(java.lang.String proxyName)

      Check if a Proxy is registered

      Parameters:
      proxyName - proxy name
      Returns:
      whether a Proxy is currently registered with the given proxyName.
    • registerCommand

      void registerCommand​(java.lang.String notificationName, java.util.function.Supplier<ICommand> commandSupplier)

      Register an ICommand with the Controller.

      Parameters:
      notificationName - the name of the INotification to associate the ICommand with.
      commandSupplier - a reference to the Command Supplier Function of the ICommand.
    • removeCommand

      void removeCommand​(java.lang.String notificationName)

      Remove a previously registered ICommand to INotification mapping from the Controller.

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

      boolean hasCommand​(java.lang.String notificationName)

      Check if a Command is registered for a given Notification

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

      void registerMediator​(IMediator mediator)

      Register an IMediator instance with the View.

      Parameters:
      mediator - a reference to the IMediator instance
    • retrieveMediator

      IMediator retrieveMediator​(java.lang.String mediatorName)

      Retrieve an IMediator instance from the View.

      Parameters:
      mediatorName - the name of the IMediator instance to retrievve
      Returns:
      the IMediator previously registered with the given mediatorName.
    • removeMediator

      IMediator removeMediator​(java.lang.String mediatorName)

      Remove a IMediator instance from the View.

      Parameters:
      mediatorName - name of the IMediator instance to be removed.
      Returns:
      the IMediator instance previously registered with the given mediatorName.
    • hasMediator

      boolean hasMediator​(java.lang.String mediatorName)

      Check if a Mediator is registered or not

      Parameters:
      mediatorName - mediator name
      Returns:
      whether a Mediator is registered with the given mediatorName.
    • notifyObservers

      void notifyObservers​(INotification notification)

      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.

      Parameters:
      notification - the INotification to notify IObservers of.