Dojo Toolkit

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Dojo Toolkit
Developed by Dojo Foundation
Latest release 1.2.3 / December 8, 2008
Written in JavaScript
OS Cross-platform
Type JavaScript toolkit (or library)
License BSD License and the Academic Free License

The Dojo Toolkit is a modular open source JavaScript toolkit (or library), 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 BSD License and the Academic Free License. The Dojo Foundation is a non-profit organization[1] designed to promote the adoption of the toolkit.


[edit] Features

[edit] Widgets

Dojo widgets are prepackaged components of JavaScript code, HTML markup and CSS style declarations that can be used to enrich websites with various interactive features that work across browsers:

[edit] 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 being done with the JavaScript command XMLHttpRequest. Dojo provides an abstracted wrapper ( around various web browsers' implementations of XMLHttpRequest, which can also use 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.

[edit] 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 Apache Ant 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). Pre-built profiles for some common use cases are available for download from the same location as the full toolkit.

[edit] 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 [2], 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 encapsulated from the storage mechanism used, and is presented with a simple hash table abstraction, with methods such as put() and get().

[edit] Server-side data storage

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

  • 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 web service
  • RdfStore: a read-write store that uses SPARQL to talk to RDF data servers including, for example, the Rhizome RDF application server.

[edit] 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.[4]

[edit] Developing Dojo

Dojo development can be done with the Aptana IDE or Komodo. There is a community-version of Aptana and a 21-day trial of Komodo. Dojo-Plugins are available for both (currently Dojo 0.4.3, 0.9.0, and 1.2.0). For WYSIWYG development using Dojo, one can use the open source WaveMaker Visual Ajax Studio.

[edit] Dojo Foundation and Sponsorship

Both IBM[5] and Sun Microsystems[6] have 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 to the Zend Framework[7]

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
  • DWR
  • Psych Desktop (to be renamed "Lucid Desktop")[8]

[edit] See also

[edit] External links

[edit] References

  1. ^ a b The Dojo Foundation - Donate
  2. ^ "Adobe Flash Player Version Penetration". Adobe website.
  3. ^ "Dojo Data" (2007-01-11). Retrieved on 2007-02-03.
  4. ^ [1]
  5. ^ "IBM Contributes Ajax Software Development Technology to Open Source Community". IBM Press Release (2006-06-05). Retrieved on 2007-02-03.
  6. ^ ""Sun Joins the OpenAJAX Alliance and Dojo Foundation"". Sun Microsystems Press Release (2006-06-16). Retrieved on 2007-02-03.
  7. ^ Dojo and Zend Framework Partnership Announcement
  8. ^ [2]
Personal tools