new Facade()
+ + + + + +A base Multiton Facade
implementation.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + +
- See: +
-
+
-
+
- Model Model + +
- View View + +
- Controller Controller +
+
+
+
+
Members
+ + + +(static) instanceMap :Map.<string, Facade>
+ + + + + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Type:
+-
+
-
+
+
Map.<string, Facade>
+ + +
+
(static) MULTITON_MSG
+ + + + +Message Constants
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Methods
+ + + +(static) getInstance(key, factory) → {Facade}
+ + + + + +Facade Multiton Factory method
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
key |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ + + + | +
factory |
+
+
+
+
+
+function
+
+
+
+ |
+
+
+
+
+
+ + + + | +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Facade
+ + +
+
the Multiton instance of the Facade
+(static) hasCore(key) → {boolean}
+ + + + + +Check if a Core is registered or not
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
key |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ the multiton key for the Core in question + + |
+
Returns:
+ + + +-
+
- + Type: + +
-
+
+
boolean
+ + +
+
whether a Core is registered with the given key
.
(static) removeCore(key)
+ + + + + +Remove a Core.
+Remove the Model, View, Controller and Facade +instances for the given key.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
key |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ multitonKey of the Core to remove + + |
+
hasCommand(notificationName) → {boolean}
+ + + + + +Check if a Command is registered for a given Notification
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
notificationName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ + + + | +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
boolean
+ + +
+
whether a Command is currently registered for the given notificationName
.
hasMediator(mediatorName) → {boolean}
+ + + + + +Check if a Mediator
is registered or not
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
mediatorName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ + + + | +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
boolean
+ + +
+
whether a Mediator is registered with the given mediatorName
.
hasProxy(proxyName) → {boolean}
+ + + + + +Check if a Proxy
is registered
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
proxyName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ + + + | +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
boolean
+ + +
+
whether a Proxy is currently registered with the given proxyName
.
initializeController()
+ + + + + +Initialize the Controller
.
Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:
+-
+
- You wish to initialize a different `Controller`. +
- You have `Commands` to register with the `Controller` at startup.`. +
If you don't want to initialize a different `Controller`, +call `super.initializeController()` at the beginning of your +method, then register `Command`s.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
initializeFacade()
+ + + + + +Initialize the Multiton Facade
instance.
Called automatically by the constructor. Override in your +subclass to do any subclass specific initializations. Be +sure to call `super.initializeFacade()`, though.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
initializeModel()
+ + + + + +Initialize the Model
.
Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:
+-
+
- You wish to initialize a different `Model`. +
- You have `Proxy`s to register with the Model that do not +retrieve a reference to the Facade at construction time.` +
If you don't want to initialize a different Model
,
+call super.initializeModel()
at the beginning of your
+method, then register Proxy
s.
Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Proxy`s +with the `Model`, since `Proxy`s with mutable data will likely +need to send `Notification`s and thus will likely want to fetch a reference to +the `Facade` during their construction.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
initializeNotifier()
+ + + + + +Set the Multiton key for this facade instance.
+Not called directly, but instead from the +constructor when getInstance is invoked. +It is necessary to be public in order to +implement Notifier.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
initializeView()
+ + + + + +Initialize the View
.
Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:
+-
+
- You wish to initialize a different `View`. +
- You have `Observers` to register with the `View` +
If you don't want to initialize a different `View`, +call `super.initializeView()` at the beginning of your +method, then register `Mediator` instances.
+Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Mediator`s +with the `View`, since `Mediator` instances will need to send +`Notification`s and thus will likely want to fetch a reference +to the `Facade` during their construction.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
notifyObservers(notification)
+ + + + + +Notify Observer
s.
This method is left public mostly for backward +compatibility, and to allow you to send custom +notification classes using the facade.
+Usually you should just call `sendNotification` +and pass the parameters, never having to +construct the notification yourself.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
notification |
+
+
+
+
+
+Notification
+
+
+
+ |
+
+
+
+
+
+
+ the |
+
registerCommand(notificationName, factory)
+ + + + + +Register a Command
with the Controller
by Notification name.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
notificationName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ the name of the |
+
factory |
+
+
+
+
+
+function
+
+
+
+ |
+
+
+
+
+
+
+ a reference to the factory of the |
+
registerMediator(mediator)
+ + + + + +Register a Mediator
with the View
.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
mediator |
+
+
+
+
+
+Mediator
+
+
+
+ |
+
+
+
+
+
+
+ a reference to the |
+
registerProxy(proxy)
+ + + + + +Register a Proxy
with the Model
by name.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
proxy |
+
+
+
+
+
+Proxy
+
+
+
+ |
+
+
+
+
+
+
+ the |
+
removeCommand(notificationName)
+ + + + + +Remove a previously registered Command
to Notification
mapping from the Controller.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
notificationName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ the name of the |
+
removeMediator(mediatorName) → {Mediator}
+ + + + + +Remove a Mediator
from the View
.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
mediatorName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ name of the |
+
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Mediator
+ + +
+
the Mediator
that was removed from the View
removeProxy(proxyName) → {Proxy}
+ + + + + +Remove a Proxy
from the Model
by name.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
proxyName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ the |
+
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Proxy
+ + +
+
the Proxy
that was removed from the Model
retrieveMediator(mediatorName) → {Mediator}
+ + + + + +Retrieve a Mediator
from the View
.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
mediatorName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ + + + | +
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Mediator
+ + +
+
the Mediator
previously registered with the given mediatorName
.
retrieveProxy(proxyName) → {Proxy}
+ + + + + +Retrieve a Proxy
from the Model
by name.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + + + + +Description | +
---|---|---|
proxyName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+
+ the name of the proxy to be retrieved. + + |
+
Returns:
+ + + +-
+
- + Type: + +
-
+
+
Proxy
+ + +
+
the Proxy
instance previously registered with the given proxyName
.
sendNotification(notificationName, bodyopt, typeopt)
+ + + + + +Create and send an Notification
.
Keeps us from having to construct new notification +instances in our implementation code.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
- + + + + + + + +
Parameters:
+ + +Name | + + +Type | + + +Attributes | + + + +Default | + + +Description | +
---|---|---|---|---|
notificationName |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+ + + + + + + | + + + ++ + | + + +
+ the name of the notification to send + + |
+
body |
+
+
+
+
+
+Object
+
+
+
+ |
+
+
+
+
+ <optional> + + + + + + |
+
+
+
+ + + null + + | + + +
+ body the body of the notification (optional) + + |
+
type |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+ <optional> + + + + + + |
+
+
+
+ + + | + + +
+ type the type of the notification (optional) + + |
+