Dojo Overview
Dojo Overview
Dojo Overview
Date: 06/01/2008
1
Agenda
1. Overview
2. Core
3. Dijit
4. Dojox
5. Common NOL Client Side Architecture
6. Q&A
2
Overview
What is Dojo?
• Dojo is an open-source JavaScript toolkit that provides an API and reusable assets that assists in
the development of web applications
Why Dojo?
• Architectural decision to provide AJAX and enhanced GUI features to the client
• To promote code reuse, code consistency, and a object oriented approach to client side scripting
3
Dojo Core
• JSON encoding/decoding
• Package loading
• Unified events
• Animation support
• Language utilities
• CCS style and positioning support
• OOP support
• Firebug integration
• Dojo Objective Harness (Unit testing)
• Unified data access (dojo.data)
• Universal debugging tools
4
Dojo Core - JSON
What is JSON?
• JSON stands for Java Script Object Notation. JSON is a human-readable data-interchange format
that represents data structures and arrays.
JSON Example:
{ "firstName": "John",
"lastName": "Smith",
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": 10021 },
"phoneNumbers": [
"212 555-1234",
"646 555-4567" ]
}
5
Dojo Core
Example Class:
dojo.require("dojo.parser");
dojo.declare("Person", null, {
moveToNewState: function(newState){
this.currentResidence=newState;
}
});
6
Dojo Dijit
What is Dijit?
• Dijit is a collection of widgets utilizing the Dojo Core to provide GUI themes, form controls, layouts,
and the ability to extend and customize
• Takes existing HTML elements and extends them to provide extension points for a developer
7
Dojo Dijit
8
Dojo Dijit - Custom Widgets
Provides the ability to write encapsulated views and reuse them within a page.
Example:
Example Code:
9
Dojo Dijit – Custom Widget
10
Dojo Dojox
Future considerations:
• Dojo Wire
• Comet
• Pagination
11
CNOL Client Architecture
Example from Declarative and Programmatic Data Wiring in dojo presentation by Jared Jurkiewicz
12
CNOL Client Architecture
13
Q&A
Questions?
14