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 Notificationboolean
hasMediator(java.lang.String mediatorName)
Check if a Mediator is registered or notboolean
hasProxy(java.lang.String proxyName)
Check if a Proxy is registeredvoid
notifyObservers(INotification notification)
Notify theIObservers
for a particularINotification
.void
registerCommand(java.lang.String notificationName, java.util.function.Supplier<ICommand> commandSupplier)
Register anICommand
with theController
.void
registerMediator(IMediator mediator)
Register anIMediator
instance with theView
.void
registerProxy(IProxy proxy)
Register anIProxy
with theModel
by name.void
removeCommand(java.lang.String notificationName)
Remove a previously registeredICommand
toINotification
mapping from the Controller.IMediator
removeMediator(java.lang.String mediatorName)
Remove aIMediator
instance from theView
.IProxy
removeProxy(java.lang.String proxyName)
Remove anIProxy
instance from theModel
by name.IMediator
retrieveMediator(java.lang.String mediatorName)
Retrieve anIMediator
instance from theView
.IProxy
retrieveProxy(java.lang.String proxyName)
Retrieve aIProxy
from theModel
by name.Methods inherited from interface org.puremvc.java.interfaces.INotifier
sendNotification, sendNotification, sendNotification
-
Method Details
-
registerProxy
Register an
IProxy
with theModel
by name.- Parameters:
proxy
- theIProxy
to be registered with theModel
.
-
retrieveProxy
Retrieve a
IProxy
from theModel
by name.- Parameters:
proxyName
- the name of theIProxy
instance to be retrieved.- Returns:
- the
IProxy
previously regisetered byproxyName
with theModel
.
-
removeProxy
Remove an
IProxy
instance from theModel
by name.- Parameters:
proxyName
- theIProxy
to remove from theModel
.- Returns:
- the
IProxy
that was removed from theModel
-
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 theController
.- Parameters:
notificationName
- the name of theINotification
to associate theICommand
with.commandSupplier
- a reference to the Command Supplier Function of theICommand
.
-
removeCommand
void removeCommand(java.lang.String notificationName)Remove a previously registered
ICommand
toINotification
mapping from the Controller.- Parameters:
notificationName
- the name of theINotification
to remove theICommand
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
Register an
IMediator
instance with theView
.- Parameters:
mediator
- a reference to theIMediator
instance
-
retrieveMediator
Retrieve an
IMediator
instance from theView
.- Parameters:
mediatorName
- the name of theIMediator
instance to retrievve- Returns:
- the
IMediator
previously registered with the givenmediatorName
.
-
removeMediator
Remove a
IMediator
instance from theView
.- Parameters:
mediatorName
- name of theIMediator
instance to be removed.- Returns:
- the
IMediator
instance previously registered with the givenmediatorName
.
-
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
Notify the
IObservers
for a particularINotification
.All previously attached
IObservers
for thisINotification
's list are notified and are passed a reference to theINotification
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
- theINotification
to notifyIObservers
of.
-