﻿// register the AjaxTutorial namespace
Type.registerNamespace("AjaxTutorial");
    
// define the Student class
AjaxTutorial.Student = function(name) 
{
  // initialize base class
  AjaxTutorial.Student.initializeBase(this, [name]);

  // notify student creation
  Sys.Debug.trace("Student created: " + name);
}  

// create Student instance members
AjaxTutorial.Student.prototype = 
{
  // Student must implement this method of ISelfDescribingObject
  describeYourself: function()
  {
    Sys.Debug.trace(
      String.format("Hello man, I'm {0}. I'm a cool student!",
      this._name));
  },

  // Student has the function to learn
  learn: function()
  {
    Sys.Debug.trace("Student wakes up, yawns, " + 
      "stratches head, and tries to look interested.");
  }
}

// register the Student class
AjaxTutorial.Student.registerClass("AjaxTutorial.Student", 
  AjaxTutorial.Person, AjaxTutorial.ISelfDescribingObject);