Are there any good JavaScript frameworks out there which primary audience is not web programming? Especially frameworks/libraries which improves the object orientation? The framework should be usable within an desktop application embedding a JavaScript engine (such as Spidermonkey or JavaScriptCore), so no external dependency are allowed.
5 Answers
As far as "improving object orientation" goes, Javascript is already great. You just need to get used to thinking in prototypes instead of classes.
After reading Douglas Crawford's great page on prototypal inheritance I really started to enjoy working with javascript. (He also has a page on class inheritance if you must use classes.)
Edit: If by asking for a framework you also mean, helpful libraries that don't use the DOM, you might be interested in Functional Javascript.
2 Comments
Dojo can be used (and is used) in non-browser environments (e.g., Rhino, Jaxer, SpiderMonkey). It can be easily adapted for other environments too — all DOM-related functions are separated from functions dealing with global language features.
dojo.declare() (more docs) comes in the Dojo Base (as soon as you load dojo.js) and implements full-blown OOP with single- and multiple- inheritance, automatic constructor chaining, and super-calls. In fact it is the cornerstone of many Dojo facilities.
Of course there are more low-level facilities like dojo.mixin() to mix objects together and dojo.extend() to extend a prototype dynamically.
More language-related features can be found in dojox.lang. Following parts of it are thoroughly explained and documented: functional, AOP, recursion combinators.
Dojo comes with other batteries included from string-related algorithms to the date processing. If you are interested in those you can discover them yourself, or contact the Dojo community.
Comments
Objective-J(avascript) is one. Is that the kind of thing you are looking for?
1 Comment
The most widely known one is XULRunner from Mozilla. This is framework that FireFox and Thunderbird are built on.
https://developer.mozilla.org/en/XULRunner
Although not strictly javascript only, it incorporates a host of technologies closely tied to web for the purposes of building desktop applications.
1 Comment
Have you looked at Adobe Air? It allows you to use JavaScript/AJAX to write Desktop applications.