JS library for class-based OO
I would like to use an existing JS library to write class-based OO code.
I know that some libraries (like jQuery and Ext JS) can't be used because they require the DOM/browser.
What else can I use?
My current solution is to create a custom MooTools file at http://mootools.net/core that includes only the Core, Class, and Class.Extras modules.
Is there a better way?
2 Answers
-
Search for Dean Edwards "base.js" ;)
-
If you're just looking for a clean "classical" style base class with the ability to define interfaces and an inheritence/extension structure, then base.js works really well. I did notice when trying to use Base2.js and Mootools-core that the Javascript parser throws back a number of warnings and doesn't much care for single-line conditionals and for-loops that lack curly-brackets or closures that lack an assignment. FWIW