Javascript Inheritance

This seems like a nice summary of various approaches, and provides an interesting prespective on prototype based languages in general and on Javascript in particular. Some of the libraries mentioned were discussed here before.

It is tempting to compare this to various documents trying to show "how to add objects to Scheme/Haskell/etc." The solutions are rather similar...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

One approach that ain't mentioned...

... is my personal favorite, from the f(m) project: OOP with ECMAScript.

Private (and public) members, tolerable indefinitely deep inheritance, and mixin inheritance - all based on closures and prototypes.

Also, taking advantage of the object literal syntax: structs, enumerations, static objects and namespaces.

Why do people need it?

Are people just too stuck in their narrow inheritance based world to use JavaScript the way it was meant to be? Or is JavaScript's prototype based design fundamentally flawed and we really do need these inheritance scaffoldings?