Monday, April 21, 2014

[Web Technology] 1 - Dojo

<Dojo>

Introduction
  • Dojo is another great framework or Toolkit for developing ajax based applications. Dojo is selected by Struts 2 for providing ajax support in applications.
  • Dojo is actually based on JavaScript and HTML, so its easy to learn. You can learn Dojo very fast and start developing your next highly interactive web applications.
  • Dojo is the Open Source modular JavaScript Toolkit 
  • It is tool for constructing dynamic web user interfaces 
  • Dojo offers widgets, utilities, higher IO (AJAX) abstraction etc. 
  • BSD (Berkeley Software Distribution) or AFL (Academic Free license) licensed



Latest Version
version 1.9



What are the features / benefit of Dojo

  • Dojo is based on HTML and JavaScript, so its easy for the developers to learn it fast.
  • There is no requirement of learning new programming language. Just HTML and JavaScript knowledge if sufficient.
  • Dojo provides higher abstraction layer to the programmer.  So, it helps the programmers to develop powerful functions very easily.
  • Dojo has already invented the wheels for the programmers and now programmers just have to use the Dojo api into their application


What are the disadvantages of Dojo?

  • Even if Dojo is nice, beautiful etc, it is quite heavy
  • The documentation is still quite narrow
  • Needs much network
  • Developer depends on the browser support for the Dojo
  • There is no way to hide the Dojo code in case of commercial application


What is the basic structure in Dojo?
The basic directory structure of the application is very simple and it will evolve later: 
  • /index.html - The application entry point. 
  • /app - The application module. 
  • /app/main.js - The main script for app module. 


What is the point in Dojo?
  • Dojo bases on the HTML and JavaScript
  • Developer has not to use any strange programming language 
  • Dojo ups abstraction layer in a higher level 
  • Developer has not to reinvent (~ to produce an idea to 在已有事物的基礎上發明) wheel when starting programming project


What is Package System Dojo?
  • Dojo consists of JavaScript files
  • Package system takes care that only needed files are included
  • Each JavaScript file can be named as package dojo.provide(dojo.string)
  • By that name the package can be taken in use dojo.require(dojo.string)
  • One has not to remember any file or directory names
  • Only dojo.js has to be included into HTML document
  • That file takes care of initialization of Dojo
  • There is a couple of pre packaged builds that consist of different kinds of packages e.g. Widget, event or IO builds. 


Tell us about language Libraries in Dojo.
  • dojo.lang.*
  • Wrappers for common idioms
  • Functional programming APIs
  • For Example
    • dojo.lang.forEach
    • dojo.lang.map
    • dojo.lang.assert 


Give some components that comes along with Dojo framework.

  • DOJO Tree
  • DOJO Button
  • DOJO Calendar control
  • DOJO Grid
  • DOJO List box
  • and many more..


TUTORIAL

Hello World Dojo

Getting Start
Getting started with Dojo is as simple as including the dojo.js script in a web page, just like any other JavaScript file. Dojo is available on popular CDNs, so to get started enter the following in a file named hellodojo.html and open it in your web browser.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Tutorial: Hello Dojo!</title>
</head>
<body>
    <h1 id="greeting">Hello</h1>
    <!-- load Dojo -->
            data-dojo-config="async: true"></script>
</body>
</html>

Source: http://dojotoolkit.org/documentation/tutorials/1.9/hello_dojo/

Dojo’s AMD-based module architecture



<Dojo Mobile>

  • Dojo Mobile is a framework that allow you to effortlessly create cross-device-compatible mobile web applications.
  • It is a collection of classes has been architected to be lightweight, flexible, and extendable.
  • Dojo Mobile has also been created to mimic (模仿) the interface of the most commonly used devices: Android, iOS, BlackBerry, WindowsPhone so that your web application is seamless to your user.  
Key features of Dojo Mobile include
  • Complete and consistent mobile widget library (dojox/mobile) -- no need to collect widgets from multiple sources
  • Lightweight, minimal dependencies
  • Native style controls and widgets
  • Same functional behavior on desktop and mobile devices
  • Responds to both orientations as well orientation changes
  • CSS themes for most commonly used device
  • Uses CSS3-based animation where possible



10 Reasons Why Your Projects Should Use the Dojo Toolkit 

Source: http://code.tutsplus.com/tutorials/10-reasons-why-your-projects-should-use-the-dojo-toolkit--net-26072


Dojo Interview Questions

Source: http://www.withoutbook.com/Technology.php?tech=54&page=5&subject=Dojo%20Interview%20Questions%20and%20Answers


Reference:

Dojo API: http://dojotoolkit.org/api/

http://dojotoolkit.org/documentation/

http://dojotoolkit.org/documentation/tutorials/1.6/hello_dojo/

http://www.roseindia.net/dojo/

http://www.javabeat.net/qna/dojo/1/


No comments:

Post a Comment