controller.rb

Path: src/org/puremvc/ruby/core/controller.rb
Last Update: Mon Dec 29 18:52:44 -0600 2008

In PureMVC, the Controller class assumes these responsibilities:

  • Remembering which Command is intended to handle which Notification.
  • Registering itself as an Observer with the View for each Notification that it has an Command mapping for.
  • Creating instances of the proper Command to handle a given Notification when notified by the View.
  • Calling the Command‘s execute method, passing in the Notification.

Your application must register any Commands with the Controller.

The simplest way is to subclass Facade, and use its initializeController method to add your registrations.

[Validate]