Jump to content

Dojo Toolkit

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by DavidBiesack (talk | contribs) at 13:46, 27 June 2012 (Change links to Dojo Foundation to home page, not donate page (make impartial, not advocacy)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Dojo Toolkit
Developer(s)Dojo Foundation
Stable release
1.7.2 / February 16, 2012 (2012-02-16)
Repository
Written inJavaScript
Operating systemCross-platform
TypeJavaScript toolkit (or library)
LicenseThe modified BSD license or the Academic Free License (≥ 2.1)
Websitehttp://dojotoolkit.org

Dojo Toolkit is an open source modular JavaScript library (or more specifically JavaScript toolkit) designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. It was started by Alex Russell, Dylan Schiemann, David Schontzler, and others in 2004 and is dual-licensed under the modified BSD license or the Academic Free License (≥ 2.1). The Dojo Foundation is a non-profit organization[1] created with the goal to promote the adoption of the toolkit.

Dijit widget system

Widgets

Dojo widgets are components — comprising JavaScript code, HTML markup, and CSS style declarations — that provide cross-browser, interactive features:

  • Menus, tabs, and tooltips
  • Sortable tables
  • Dynamic charts
  • 2D vector drawings
  • Animated effects—fades, wipes and slides—facilities for custom animation effects
  • Tree widgets that support drag-and-drop
  • Various forms and routines for validating form input
  • Calendar-based date selector, time selector, and clock
  • Core widgets
  • Maps (geographical openlayer-based maps & dashboard vector-based maps)
  • Gauges (horizontal, vertical, circular)
  • Also for 3D

Themes

Skins can be used to change the look and feel of Dojo widgets that are used on a page.[2]

Features

Asynchronous communication

One important feature of Ajax applications is asynchronous communication of the browser with the server: information is exchanged and the page's presentation is updated without a need for reloading the whole page. Traditionally, this is done with the JavaScript object XMLHttpRequest. Dojo provides an abstracted wrapper (dojo.xhr) around various web browsers' implementations of XMLHttpRequest, and dojo.io also supports other transports (such as hidden IFrames) and a variety of data formats. Using this approach, it is easy to have the data a user enters into a form sent to the server "behind the scenes"; the server can then reply with some JavaScript code that updates the presentation of the page.

Packaging system

Dojo provides a packaging system to facilitate modular development of functionality in individual packages and sub-packages; the base Dojo "bootstrap" script initializes a set of hierarchical package namespaces -- "io", "event", etc. -- under a root "dojo" namespace. After initialization of the root namespace any Dojo package can be loaded (via XMLHttpRequest or other similar transport) by using utility functions supplied in the bootstrap. It is also possible to initialize additional namespaces within or parallel to the "dojo" namespace, allowing extensions of Dojo or the development of private Dojo-managed namespaces for third-party libraries and applications.

Dojo packages can consist of multiple files, and can specify which files constitute the entire package. Any package or file can also specify a dependency on other packages or files; when the package is loaded, any dependencies it specifies will also be loaded.

Workarounds for cross-domain loading of most Dojo packages are provided (though this requires a specialized build of Dojo).

Dojo also provides a mechanism for building "profiles"; the build system takes as input a list of packages, and uses Rhino to create a single compressed JavaScript file containing those packages and all their dependencies. This allows all necessary code to be loaded and initialized at once, and permits caching of the code (most web browsers do not cache files loaded via XMLHttpRequest[citation needed]). Pre-built profiles for some common use cases are available for download from the same location as the full toolkit.

Client-side data storage

In addition to providing support functions for reading and writing cookies, Dojo also provides a local, client-side storage abstraction named Dojo Storage. Dojo Storage allows web applications to store data on the client-side, persistently and securely and with a user's permission. It works across existing web browsers, including Internet Explorer, Firefox, and Safari. When included in a web page, Dojo Storage determines the best method for persistently storing information. On Firefox 2, it uses native browser persistence; on other browsers it uses a hidden Flash applet. With Flash 6+ being installed on about 95% of computers connected to the web,[3] this makes the storage mechanism accessible for much of the web's installed base. For a web application that is being loaded from the file system (i.e. from a file:// URL), Dojo Storage will transparently use XPCOM on Firefox and ActiveX on Internet Explorer to persist information. The programmer using Dojo Storage is abstracted from the storage mechanism used and is presented with a simple hash table abstraction, with methods such as put() and get(). Dojo Storage is not supported in versions later than the 1.3 release.

Server-side data storage

As of January 2007, Dojo includes the following example server-side datastore implementations in the dojo.data namespace[4]:

  • CsvStore: a read-only store that reads tabular data from comma-separated values files
  • OpmlStore: a read-only store that reads hierarchical data from OPML format files
  • YahooStore: a read-only store that fetches search results from the Yahoo! Search web service
  • DeliciousStore: a read-only store that fetches bookmarks from the del.icio.us web service
  • RdfStore: a read-write store that uses SPARQL to talk to RDF data servers including, for example, the Rhizome RDF application server.

Support for Adobe Integrated Runtime (AIR)

Dojo can be used in JavaScript-based Adobe AIR applications. It has been modified to meet AIR's security requirements.

Sitepen, a Dojo consulting company, has made an Adobe AIR application called "Dojo Toolbox" using Dojo. It includes an API viewer, and a GUI to Dojo's build system. Normally, the build system is run from within Rhino, but in this AIR application the build system can be run from AIR, without use of java.[5]

Release history

Version number Release date Additional notes
0.1 2005-08-30 [6]
0.2 2005-12-14 [6]
0.3 2006-05-12 [6]
0.4 2006-11-05 [6]
0.9 2007-09-14 [6] Total rewrite
1.0 2007-11-05 [6] First stable release
1.0.1 2007-09-13 [7]
1.0.2 2007-09-13 [7]
1.1 2008-03-26 [6]
1.1.1 2008-05-13 [7]
1.2 2008-10-02 [6]
1.2.1 2008-11-06 [7]
1.2.2 2008-11-16 [7]
1.2.3 2008-12-08 [7]
1.3.0 2009-03-26 [6]
1.3.1 2009-04-30 [7]
1.3.2 2009-07-15 [7]
1.4.0 2009-12-07 [7]
1.4.1 2010-01-25 [7]
1.4.2 2010-03-10 [7]
1.4.3 2010-05-01 [7]
1.5.0 2010-07-22 [7]
1.5.2 2012-02-09
1.6.0 2011-03-15 [7] Support HTML5 data attributes.
1.6.1 2011-05-20 [7]
1.7.0 2011-10-27 Start using AMD (Asynchronous Module Definition) API. [8]
1.7.1 2011-12-16
1.7.2 2012-02-16

Criticisms

Documentation

The documentation for Dojo is of varying quality, with much information scattered between reference documentation, API documentation and tutorial-style documentation pages, and many of the reference documentation pages on the official site being blank apart from text such as "TODO: how to use the component/class/method"[9].

Additionally, although there are several books on Dojo, they typically date from 2008 or 2009 and so do not cover more recent versions of Dojo.

Inflexibility

Although Dojo offers many "off the shelf" components that might be useful for a developer, some [weasel words] argue that it lacks flexibility or requires excessive overhead.

Developing Dojo

Dojo development can be done with any suitable editor. Some examples are Netbeans IDE, Eclipse IDE, Aptana IDE, and Komodo. Netbeans and Eclipse are Free software while there are community-versions of both Aptana and Komodo. Dojo-Plugins are available for many IDEs. For WYSIWYG development using Dojo, one can use the open source WaveMaker Visual Ajax Studio or Maqetta (HTML5 visual page editor from the Dojo Foundation), which also supports Team Reviewing.

Dojo Foundation and sponsorship

In 2006, both IBM[10] and Sun Microsystems[11] announced official support for Dojo, including code contributions.

Zend Technologies, the company behind the PHP core, has announced a partnership with Dojo, to incorporate it into the Zend Framework.[12]

The Dojo Foundation is a 501(c)(6) non-profit organization founded to help open source projects. Its primary goals are to aid in adoption by companies, and encourage projects in the foundation to collaborate with one another.[1]

Its sponsors and members are:

The Dojo Foundation also helps the following projects, in inclusion to the Dojo Toolkit:

  • Persevere
  • OpenRecord
  • Cometd (for the Comet content-streaming paradigm)
  • DWR
  • Lucid Desktop [13]

See also

References

  1. ^ a b The Dojo Foundation
  2. ^ [1]
  3. ^ "Adobe Flash Player Version Penetration". Adobe website.
  4. ^ "Dojo Data". 2007-01-11. Archived from the original on 2007-02-13. Retrieved 2007-02-03.
  5. ^ [2]
  6. ^ a b c d e f g h i A Visual History of Dojo. Retrieved 2012-04-20.
  7. ^ a b c d e f g h i j k l m n o OpenLogic Exchange Dojo Toolkit Download. Retrieved on 2012-04-20
  8. ^ The Dojo Loader. Retrieved on 2012-04-20
  9. ^ http://dojotoolkit.org/reference-guide/dojox/collections.html#dojox-collections
  10. ^ "IBM Contributes Ajax Software Development Technology to Open Source Community". IBM Press Release. 2006-06-05. Retrieved 2007-02-03.
  11. ^ "Sun Joins the OpenAJAX Alliance and Dojo Foundation". Sun Microsystems Press Release. 2006-06-16. Retrieved 2007-02-03.
  12. ^ Dojo and Zend Framework Partnership Announcement
  13. ^ [3]

Further reading