Mastering the Dojo Toolkit, part 1th: Dojo Introduction

Source: Internet
Author: User
Tags command line dojo toolkit java util

With the boom in Web 2.0, Ajax, and RIA, all kinds of AJAX development kits are springing up, and Dojo is the leader in these toolkits. Dojo provides a complete end-to-end solution for the development of rich Internet Applications (RIA), including the core JavaScript library, Easy-to-use widget system, and a test framework, and the dojo Open source development Community is constantly providing new functionality for it.

Dojo is a JavaScript-implemented open source DHTML toolkit. It was established on the basis of several project contributions (Nwidgets,f (m), Burstlib). Dojo's original goal was to solve some of the long-standing historical problems of developing DHTML applications, and now Dojo has become a tool for developing RIA applications:

Dojo makes it easier for you to add dynamic capabilities to your Web pages, or you can use Dojo in other JavaScript-enabled environments;

With the components that Dojo provides, you can improve the usability and interactivity of your WEB applications;

Dojo largely masks the differences between browsers, so you don't have to worry about whether Web pages are available in some browsers.

With the tools provided by Dojo, you can also write command line unit test code for your code.

Dojo's packaging tools can help you optimize JavaScript code and build only the minimum set of Dojo packages needed to deploy your application.

Next, let's look at how Dojo organizes these functional components.

Dojo Architecture

The dojo architecture is shown in Figure 1, and in general, Dojo is a layered architecture. The bottom layer is the package system, the Dojo API structure is similar to Java, it divides all the APIs into different packages (package), and when you want to use an API, just import the package where the API resides. The top layer of the package system is the language library, which contains some language tool APIs, similar to Java util packages. The next layer is the environment-related package, which is the function of dealing with cross-browser issues.

Figure 1. Dojo Architecture Diagram

Most of the code in Dojo is in the Application support library, and because of too little restriction, all packages are not listed in Figure 1. Most of the time, developers are calling the APIs in this layer, for example, using IO packages to make Ajax calls.

The top layer is the Dojo widget system, which refers to an element in the user interface, such as buttons, progress bars, and trees. The Dojo Widget is based on the MVC architecture. Its view is stored as a Template (template), where HTML and CSS fragments are placed in the Template, and the controller operates on the elements in that Template. Widgets not only support custom style sheets, but also handle the events of internal elements. Users only need to add a simple label on the page to use. In this layer, there are hundreds of powerful widgets for users to use, including tables, trees, menus, and so on.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.