pub trait Facade<Body> where
Body: Debug + 'static, {
fn register_command(
&self,
interest: Interest,
command: Rc<dyn Command<Body>>
);
fn remove_command(&self, interest: &Interest);
fn has_command(&self, interest: &Interest) -> bool;
fn send(&self, interest: Interest, body: Option<Body>);
}
Expand description
The 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.
Also Facade should implement IModel trait with Model for different data types and IView
Required Methods
fn register_command(&self, interest: Interest, command: Rc<dyn Command<Body>>)
fn register_command(&self, interest: Interest, command: Rc<dyn Command<Body>>)
Register an Command with the Controller.
fn remove_command(&self, interest: &Interest)
fn remove_command(&self, interest: &Interest)
Remove a previously registered Command to Notification mapping from the Controller.
fn has_command(&self, interest: &Interest) -> bool
fn has_command(&self, interest: &Interest) -> bool
Check if a Command is registered for a given Notification
Create and send an Notification.