Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which JavaScript Library Has the Most Comprehensive Class Inheritance Support? [closed]

Tags:

After playing with a dozen different JavaScript Libraries such as Prototype, jQuery, YUI, just to name a few, I found every different library has a different way of simulating some sort of Class Hierarchy and provide some sort of Class Inheritance support. (Other than jQuery) Other than being very annoyed that when you create a new class, it has to be library dependent, unless you do the plain old way.

I'm wondering which library offers the best support for class inheritance in general and why.

I hope maybe one day JavaScript Library authors can agree on one style for Class creation and inheritance.

like image 213
Aaron Qian Avatar asked Apr 02 '09 19:04

Aaron Qian


People also ask

Does JavaScript support inheritance?

When it comes to inheritance, JavaScript only has one construct: objects. Each object has a private property which holds a link to another object called its prototype. That prototype object has a prototype of its own, and so on until an object is reached with null as its prototype.

What is inheritance in JavaScript?

Inheritance enables you to define a class that takes all the functionality from a parent class and allows you to add more. Using class inheritance, a class can inherit all the methods and properties of another class. Inheritance is a useful feature that allows code reusability.

What is the difference between class and prototypal inheritance?

The most important difference between class- and prototype-based inheritance is that a class defines a type which can be instantiated at runtime, whereas a prototype is itself an object instance.


1 Answers

I found out there is a Javascript Framework modeled after Ruby:

Js.Class

Another good one is:

Joose-js (modeled after moose (perl) )

I prefer Josse, because it seems to be more actively developed, and the syntax looks neat too!

Any thoughts??? (Maybe this should be another question??)

like image 108
Aaron Qian Avatar answered Oct 24 '22 20:10

Aaron Qian