﻿// register the AjaxTutorial namespace
Type.registerNamespace("AjaxTutorial");
    
// define the Manager class
AjaxTutorial.Manager = function(name) 
{
  // initialize base class
  AjaxTutorial.Manager.initializeBase(this, [name]);

  // notify manager creation
  Sys.Debug.trace("Manager created: " + name);
}

// define Manager instance members
AjaxTutorial.Manager.prototype = 
{
  // method of ISelfDescribingObject interface
  describeYourself : function()
  {
    Sys.Debug.trace(String.format(
      "I’m {0}. I'm the boss around here.", this._name));
  },

  // method of IEmployee interface
  startWorking: function()
  {
    Sys.Debug.trace("No, it's my golf day!");
  }
}
    
// register the Manager class
AjaxTutorial.Manager.registerClass("AjaxTutorial.Manager",
  AjaxTutorial.Person, AjaxTutorial.ISelfDescribingObject, 
  AjaxTutorial.IEmployee);
