/15/ design patterns: mvc implementation (practice)
// PACKAGE
AsSetupPackage("org.moock.util");

// CLASS AbstractController

/**
 * Provides basic facilities for the "controller" of
 * a Model/View/Controller triad. (The view
 * implements the View interface, while the model 
 * is a descendent of Observable.)
 *
 * @param   m   The model this controller's view is observing.
 */
org.moock.util.AbstractController = function (m) {
  // Register the model for this controller.
  this.setModel(m);
}

// PROPERTIES
  org.moock.util.AbstractController.prototype.model = null;
  org.moock.util.AbstractController.prototype.view = null;

// METHODS
  /**
   * Sets the model for this controller.
   */
  org.moock.util.AbstractController.prototype.setModel = function (m) {
    this.model = m;
  }

  /**
   * Returns the model for this controller.
   */
  org.moock.util.AbstractController.prototype.getModel = function () {
    return this.model;
  }

  /**
   * Sets the view this controller is servicing.
   */
  org.moock.util.AbstractController.prototype.setView = function (v) {
    this.view = v;
  }

  /**
   * Returns this controller's view.
   */
  org.moock.util.AbstractController.prototype.getView = function () {
    return this.view;
  }
/**
 * interface org.moock.util.View
 * 
 * This interface specifies the minimum facilities that must be
 * provided by the "view" of a Model/View/Controller triad.
 * (The controller is a descendent of AbstractController,
 * while the model is a descendent of Observable.)
 */

  /**
   * View.setModel(m)
   *
   * Sets the model this view is observing.
   */

  /**
   * View.getModel()
   *
   * Returns the model this view is observing.
   */

  /**
   * View.setController(c)
   *
   * Sets the controller for this view.
   */

  /**
   * View.getController()
   *
   * Returns this view's controller.
   */