ArticleslgStudy

computer science

Dojo (web framework)

Dojo (web framework) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Dojo (web framework) rather than just read about it. In short: Dojo (stylized as Dojo Toolkit or dōjō toolkit before 2.0) is an open-source modular JavaScript library (or more specifically toolkit or UI framework) 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 L…

Dojo (web framework) — main illustration
Dojo (web framework) — illustration

Key takeaways

  • Dojo (web framework) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Dojo (web framework) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Dojo (web framework) from memory before moving on to harder problems.

Reference excerpt

Dojo (stylized as Dojo Toolkit or dōjō toolkit before 2.0) is an open-source modular JavaScript library (or more specifically toolkit or UI framework) 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 was a non-profit organization created with the goal to promote the adoption of the toolkit. In 2016, the foundation merged with the jQuery Foundation to become the JS Foundation which in 2019 subsequently merged with the Node.js Foundation to form the OpenJS Foundation

Overview Dojo is a JavaScript framework targeting the many needs of large-scale client-side web development. For example, Dojo abstracts the differences among diverse browsers to provide APIs that will work on all of them (it can even run on the server under Node.js); it establishes a framework for defining modules of code and managing their interdependencies; it provides build tools for optimizing JavaScript and CSS, generating documentation, and unit testing; it supports internationalization, localization, and accessibility; and it provides a rich suite of commonly needed utility classes and user-interface widgets. Dojo is completely open source. The toolkit includes about three thousand JavaScript modules, in addition to images and other resources. The Dojo Toolkit is organized in several parts:

dojo contains the core and most non-visual modules. dijit is a library of user-interface modules for widgets and layout. dojox holds assorted modules not yet considered stable enough to include in dojo or dijit. util includes build tools such as optimization, documentation, style-checking, and testing.

Features

Widgets Dojo widgets are components — comprising JavaScript code, HTML markup, and CSS style declarations — that provide multi-browser (not to be confused with 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

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

Client-side data storage Dojo has support functions for reading and writing cookies. It also previously supported 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. When included in a web page, Dojo Storage determines the best method for persistently storing information. It works across existing web browsers, including Internet Explorer, Firefox, and Safari. Firefox 2 uses native browser persistence; on other browsers, it uses a hidden Flash applet. With Flash 6+ have previously been installed on about 95% of computers connected to the web, this previously made the storage mechanism accessible for much of the web's installed base. For a web application 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:

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.

… excerpt ends here. Continue reading the full article.

Illustrations

Dojo (web framework) illustration

Worked examples

Example 1 — a first encounter with Dojo (web framework)

Start with the simplest possible case. Write down what Dojo (web framework) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Dojo (web framework) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Dojo (web framework) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Dojo (web framework)

In research
Dojo (web framework) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Dojo (web framework) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Dojo (web framework) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Ajax (programming), JavaScript-based HTML editors, JavaScript libraries, so understanding it makes those chapters shorter.
In everyday life
Look for Dojo (web framework) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Dojo (web framework)” →

How to study Dojo (web framework) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Dojo (web framework) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Dojo (web framework) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Dojo (web framework) in simple terms?

Dojo (stylized as Dojo Toolkit or dōjō toolkit before 2.0) is an open-source modular JavaScript library (or more specifically toolkit or UI framework) designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. It was started by Alex Russell, Dylan Sc…

Why does Dojo (web framework) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Dojo (web framework)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Dojo (web framework).

Tags

  • Ajax (programming)
  • JavaScript-based HTML editors
  • JavaScript libraries
  • JavaScript web frameworks
  • Linux Foundation projects
  • Rich web application frameworks
  • Software using the Academic Free License
  • Software using the BSD license

Keep exploring