org.puremvc.php.patterns.facade
[ class tree: org.puremvc.php.patterns.facade ] [ index: org.puremvc.php.patterns.facade ] [ all elements ]

Class: Facade

Source Location: /patterns/facade/Facade.php

Class Overview


A base Singleton
implementation.


Author(s):

Implements interfaces:

Variables

Methods


Child classes:

ApplicationFacade
ApplicationFacade for the BasicDemo starts the Model, View Controller for the application.

Class Details

[line 49]
A base Singleton
implementation.

In PureMVC, the

class assumes these responsibilities:
  • Initializing the
    ,
    and
    Singletons.
  • Providing all the methods defined by the
    interfaces.
  • Providing the ability to override the specific
    ,
    and
    Singletons created.
  • Providing a single point of contact to the application for registering
    1. Commands
    and notifying
    1. Observers




Tags:

see:  org.puremvc.php.patterns.proxy.Proxy Proxy
see:  org.puremvc.php.patterns.command.SimpleCommand SimpleCommand
see:  org.puremvc.php.patterns.command.MacroCommand MacroCommand
see:  org.puremvc.php.patterns.mediator.Mediator Mediator
see:  org.puremvc.php.patterns.observer.Notification Notification
see:  org.puremvc.php.core.View View
see:  org.puremvc.php.core.Controller Controller
see:  org.puremvc.php.core.Model Model


[ Top ]


Class Variables

static $instance =

[line 58]



Tags:

access:  protected

Type:   mixed


[ Top ]

$controller =

[line 53]



Tags:

access:  protected

Type:   mixed


[ Top ]

$model =

[line 54]



Tags:

access:  protected

Type:   mixed


[ Top ]

$view =

[line 55]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method getInstance [line 96]

static the getInstance( )

Facade Singleton Factory method



Tags:

return:  Singleton instance of the Facade
access:  public


Overridden in child classes as:

ApplicationFacade::getInstance()
Instance getter for the ApplicationFacade, this method starts the Facade.

[ Top ]

constructor __construct [line 71]

Facade __construct( )

Constructor.

This

implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton Factory method




Tags:

throws:  Error Error if Singleton instance has already been constructed
access:  protected


[ Top ]

method hasCommand [line 219]

whether hasCommand( notificationName $notificationName)

Check if a Command is registered for a given Notification



Tags:

return:  a Command is currently registered for the given
  1. notificationName
.
access:  public


Parameters:

notificationName   $notificationName  

[ Top ]

method hasMediator [line 294]

void hasMediator( mediatorName $mediatorName)

Check to see if a Mediator is registered with the View.



Tags:

access:  public


Parameters:

mediatorName   $mediatorName   name of the
instance to check for.

[ Top ]

method hasProxy [line 251]

void hasProxy( proxyName $proxyName)

Check to see if a Proxy is registered with the Model.



Tags:

access:  public


Parameters:

proxyName   $proxyName   name of the
instance to check for.

[ Top ]

method initializeController [line 118]

void initializeController( )

Initialize the
.

Called by the

method. Override this method in your subclass of
if one or both of the following are true:
  • You wish to initialize a different
    .
  • You have
    1. Commands
    to register with the
    at startup.</code>.
If you don't want to initialize a different
, call
at the beginning of your method, then register
  1. Command
s.




Tags:

access:  protected


Overridden in child classes as:

ApplicationFacade::initializeController()
Initializes the controller and gives you an opportunity to register application specific commands that extend SimpleCommand or MacroCommand with the PureMVC framework.

[ Top ]

method initializeFacade [line 84]

void initializeFacade( )

Initialize the Singleton
instance.

Called automatically by the constructor. Override in your subclass to do any subclass specific initializations. Be sure to call

, though.




Tags:

access:  protected


[ Top ]

method initializeModel [line 147]

void initializeModel( )

Initialize the
.

Called by the

method. Override this method in your subclass of
if one or both of the following are true:
  • You wish to initialize a different
    .
  • You have
    s to register with the Model that do not retrieve a reference to the Facade at construction time.</code>
If you don't want to initialize a different
, call
at the beginning of your method, then register
s.

Note: This method is rarely overridden; in practice you are more likely to use a

  1. Command
to create and register
s with the
, since
s with mutable data will likely need to send
s and thus will likely want to fetch a reference to the
during their construction.




Tags:

access:  protected


[ Top ]

method initializeView [line 176]

void initializeView( )

Initialize the
.

Called by the

method. Override this method in your subclass of
if one or both of the following are true:
  • You wish to initialize a different
    .
  • You have
    1. Observers
    to register with the
If you don't want to initialize a different
, call
at the beginning of your method, then register
instances.

Note: This method is rarely overridden; in practice you are more likely to use a

  1. Command
to create and register
s with the
, since
instances will need to send
s and thus will likely want to fetch a reference to the
during their construction.




Tags:

access:  protected


[ Top ]

method notifyObservers [line 187]

void notifyObservers( $notification)

Notify
s.



Tags:

access:  public


Parameters:

notification   $notification   the
to have the
notify
  1. Observers
of.

[ Top ]

method registerCommand [line 198]

void registerCommand( notificationName $notificationName, commandClassRef $commandClassRef)

Register an
with the
by Notification name.



Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the
to associate the
with
commandClassRef   $commandClassRef   a reference to the Class of the

[ Top ]

method registerMediator [line 273]

void registerMediator( $mediator, mediator 1)

Register a
with the
.



Tags:

access:  public


Parameters:

mediator   1   a reference to the
mediatorName   $mediator   the name to associate with this

[ Top ]

method registerProxy [line 230]

void registerProxy( $proxy, proxy 1)

Register an
with the
by name.



Tags:

access:  public


Parameters:

proxy   1   the
instance to be registered with the
.
proxyName   $proxy   the name of the
.

[ Top ]

method removeCommand [line 208]

void removeCommand( notificationName $notificationName)

Remove a previously registered
to
mapping from the Controller.



Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the
to remove the
mapping for

[ Top ]

method removeMediator [line 304]

void removeMediator( mediatorName $mediatorName)

Remove an
from the
.



Tags:

access:  public


Parameters:

mediatorName   $mediatorName   name of the
to be removed.

[ Top ]

method removeProxy [line 261]

void removeProxy( proxyName $proxyName)

Remove an
from the
by name.



Tags:

access:  public


Parameters:

proxyName   $proxyName   the
to remove from the
.

[ Top ]

method retrieveMediator [line 284]

the retrieveMediator( mediatorName $mediatorName)

Retrieve an
from the
.



Tags:

return:  
previously registered with the given
  1. mediatorName
.
access:  public


Parameters:

mediatorName   $mediatorName  

[ Top ]

method retrieveProxy [line 241]

the retrieveProxy( proxyName $proxyName)

Retrieve an
from the
by name.



Tags:

return:  
instance previously registered with the given
  1. proxyName
.
access:  public


Parameters:

proxyName   $proxyName   the name of the proxy to be retrieved.

[ Top ]

method sendNotification [line 320]

void sendNotification( notificationName $notificationName, [body $body = null], [type $type = null])

Send an
.

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




Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the notiification to send
body   $body   the body of the notification (optional)
type   $type   the type of the notification (optional)

[ Top ]


Documentation generated on Tue, 30 Sep 2008 08:05:43 -0700 by phpDocumentor 1.4.0