Oracle Magazine Special offer for AjaxImpact.com Visitors!! Subscribe to Oracle Magazine for Free!
AJAX IMPACT



AJAX NEWS
A Base Class for JavaScript Inheritance
03/24/2006, By Ajax Impact News



Over his blog Dean Edwards has created a new JavaScript Base class in object oriented manner, that eases the pain of JavaScript OO. It’s a simple class and extends the Object object by adding two instance methods and one class method.

He writes "I’m an OO programmer at heart and JavaScript supports prototype based inheritance."

Unfortunatley this leads to verbose class definitions:

       function Animal(name) {};
       Animal.prototype.eat = function() {};
       Animal.prototype.say = function(message) {};


I want a nice base class for JavaScript OO:

  • I want to easily create classes without the MyClass.prototype cruft


  • I want method overriding with intuitive access to the overridden method (like Java’s super)


  • I want to avoid calling a class’ constructor function during the prototyping phase


  • I want to easily add static (class) properties and methods


  • I want to achieve the above without resorting to global functions to build prototype chains


  • I want to achieve the above without affecting Object.prototype



  • Download the Base class from here Base.js

       Explore Base Class in detail ....


     Rate this Ajax News
     Rating: 0.0 out of votes cast

    AJAX NEWS
    04/01/2007 wxJavaScript : porting wxWidgets to JavaScript.
    03/31/2007 DED|Chain - The web developers JavaScript Kit
    03/30/2007 Clipperz Crypto Library - a JavaScript library of crypto primitives
    03/28/2007 ETech - AJAX Unplugged Slides
    03/27/2007 Stripe Generator: ajax powered web 2.0 tool!
    03/26/2007 Finally Microsoft joins the OpenAjax Alliance


    INDUSTRY NEWS
    05/19/2006 Ajax grabs center stage at JavaOne, By Tony Baer
    05/15/2006 Oracle to boost AJAX, Java , By Paul Krill
    05/13/2006 Open AJAX Group Drafts Development Plans, By Stacy Cowley
    05/13/2006 AJAX Powers Interactive Marketing ASP, By AjaxWorld News Desk
    05/12/2006 AJAX Experts Tackle Security, Other Issues , By Darryl K. Taft
    05/11/2006 Adobe Releases Spry Framework for AJAX, By AjaxWorld News Desk
    More 
           

          © 2008 ajaximpact.com. All rights reserved.