dojo
From QED
A modular Javascript library with CSS and images supporting:
- Ajax and other types of client-server interactions
- widgets
- animations
- internationalization [1][2]
- accessibility
- Django template language
- SQL (via Google gears)
- etc
Contents |
Background
- Started in 2004, Version 1.0 released in November 2007
- Dual-licensed under the BSD License and the Academic Free License.
- The Dojo Foundation is a non-profit organization.
- Version 1.2 released in October 2008
- Part of Google AJAX Libraries API
- Corporate support (IBM, AOL, Sun, ...)
- IBM uses Dojo in Websphere Commerce and QEDWiki.
- AOL released their second major Dojo-based web app, AIM Mail, in March 2007.
- Ajax edition of Dojo is available on the AOL Content Distribution Network (CDN), which uses geographic edge caching
- <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.2.0/dojo/dojo.xd.js"></script>
Importance (distinctiveness)
- Small, stable core
- "Pure Javascript" — "The good parts" (Crockford)
- Modularity and extensibility
- Clear separation of stable from unstable
- Only three globals: dojo, dijit, dojox
- core: dojo
- widgets: dijit
- experimental: dojox
- dojo.query — CSS3 selectors
Demos
See also
Using Google Gears
Using Flash
- Multifile Upload
- Local storage ("offline")
Tests
DOH is the dojo testing framework, e.g.
See also "tests" subdirectories under http://archive.dojotoolkit.org/nightly/dojotoolkit/
Icon Library
ArcGIS JavaScript API
ArcGIS Javascript API Home Page
"During the initial implementation process, we evaluated Prototype/Scriptaculous, YUI and pondered writing a home grown solution. But the fact that Dojo had support for vector graphics (gfx), a build system (for compression and cross domain deployment) and the wide range of widgets (dijits) made it a winner."[3]
“We have been working with Dojo for nearly 2 years now and are very happy with Dojo and the people who back it.” -- Jayant 10/30/2008 [4]
Overhead
78736 Oct 2 09:49 dojo.js
Firebug:
- first time: 134ms
- second time: 69ms
- subsequently: 0ms (cached)
dojo.require("dojo.Button");
| GET | ms |
|---|---|
| GET /dojo/dijit/form/Button.js | 60 |
| GET /dojo/dijit/form/_FormWidget.js | 64 |
| GET /dojo/dijit/_Widget.js | 64 |
| GET /dojo/dijit/_base.js | 64 |
| GET /dojo/dijit/_base/focus.js | 65 |
| GET /dojo/dijit/_base/manager.js | 70 |
| GET /dojo/dijit/_base/place.js | 65 |
| GET /dojo/dojo/AdapterRegistry.js | 62 |
| GET /dojo/dijit/_base/popup.js | 65 |
| GET /dojo/dijit/_base/window.js | 73 |
| GET /dojo/dijit/_base/scroll.js | 65 |
| GET /dojo/dijit/_base/sniff.js | 76 |
| GET /dojo/dijit/_base/typematic.js | 68 |
| GET /dojo/dijit/_base/wai.js | 62 |
| GET /dojo/dijit/_Templated.js | 77 |
| GET /dojo/dojo/string.js | 76 |
| GET /dojo/dojo/parser.js | 85 |
| GET /dojo/dojo/date/stamp.js | 113 |
| GET /dojo/dijit/_Container.js | 115 |
Total: 1389ms
Issues
- Documentation
- Difficulty using Google
- Distracting bugs in online documentation software e.g. http://api.dojotoolkit.org/jsdoc/dijit/1.2/dijit.Tree
Django
Example: recursive template definition for trees of arbitrary depth
<li>{{ country.type }}: {{ country.name }}
{% if country.children %}
<ul>
{% for country in country.childrens %}
{% include countrychildren %}
{% endfor %}
</ul>
{% endif %}
</li>
Deserialization
dojo.data.ItemFileReadStore supports deserialization, e.g. colors and dates.
{ "_type": "Date", "_value": "2008-10-10"}
The typeMap of the store is used to determine if any deserializer has been defined for the value of _type. If it has, it takes the value of _value, and calls the specified deserializer function with it.
If the deserialization function is simply a construct, the typeMap entry is trivial, e.g.
typeMap = { "Color": dojo.Color }
Persevere
"Persevere is an open source set of tools for persistence and distributed computing using simple intuitive JSON interchange using HTTP REST and JSON-RPC. The Persevere project includes a Persevere Server."
Caveats
External Links
- SMD — Service Mapping Description












