NAME

org::puremvc::perl5::patterns::observer::Notifier

Implementation of the pureMVC Notifier pattern.


DESCRIPTION

commands, mediators and proxies all have a need to send notifications.

The Notifier interface provides a common method called sendNotification that relieves implementation code of the necessity to actually construct notifications.

The Notifier class, which all of the above mentioned classes extend, provides an initialized reference to the facade singleton, which is convenient for sending notifications, but also eases implementation as these classes have frequent facade interactions and usually require access to the facade anyway.


INTERFACE

Methods

sendNotification

sub sendNotification( $notification_name, $body, $type );

Keeps us from having to construct new Notification instances in our implementation code.

  # Create and send a notification called "SayHelloWorld" with no body nor type data passed 
  $self->sendNotification("SayHelloWorld");

Parameters

Properties

_facade

PureMVC Notifier subclasses ( Mediator, Proxy, SimpleCommand, MacroCommand ) usually do not need to access this property as they will access application Facade singleton using the following instruction:

  my $facade = com::me::myapp::Facade->getInstance();

You should not have to access it and must not update it in normal usage.


SEE ALSO

org::puremvc::perl5::core::Model

org::puremvc::perl5::core::View

org::puremvc::perl5::core::Controller

org::puremvc::perl5::patterns::facade::Facade

org::puremvc::perl5::patterns::observer::Notification

org::puremvc::perl5::patterns::proxy::Proxy

org::puremvc::perl5::patterns::mediator::Mediator

org::puremvc::perl5::patterns::command::SimpleCommand

org::puremvc::perl5::patterns::command::MacroCommand

org::puremvc::perl5::patterns::observer::Observer