Create and send an Notification
.
Keeps us from having to construct new Notification instances in our implementation code.
The name of the notification to be sent.
Optional
body: anyOptional data to be included with the notification.
Optional
type: stringOptional type of the notification.
A Base
Notifier
implementation.MacroCommand, Command, Mediator
andProxy
all have a need to sendNotifications
.The
Notifier
interface provides a common method calledsendNotification
that relieves implementation code of the necessity to actually constructNotifications
.The
Notifier
class, which all the above-mentioned classes extend, provides an initialized reference to theFacade
Singleton, which is required for the convenience method for sendingNotifications
, but also eases implementation as these classes have frequentFacade
interactions and usually require access to the facade anyway.See
Notifier