Wednesday, September 9, 2009

Can't wait for my inheritance!

I am busy trying to figure out the best way to do reliable class inheritance in JavaScript without importing a third party library OR extending the prototype of a core JavaScript class (e.g. function).  Amongst a great variety of blog posts, forum answers, and random articles, I am finding Douglas Crockford's Prototypal Inheritance in JavaScript and Classical Inheritance in JavaScript the most useful in terms of edification thus far.

Other interesting resources

Quick practical examples:

Overriding instanceOf to make it work for derived types:

Poor man's "reflection" on "classes":

Microsoft's take on the subject (related to their ASP.NET AJAX libraries):

Continuing the hunt....

No comments:

Post a Comment