SlideShare une entreprise Scribd logo
1  sur  40
Dojo: Beautiful Web Apps, Fast

                      Gabe Hamilton




                     Updated for dojo 1.7.2
Gabe Hamilton

 Web Developer: Grails, Java, C#, others


 For the past 10 years that has meant a lot of
  javascript.


 Send your dojo questions to
 gabehamilton@gmail.com
What is Dojo?


A javascript toolkit


For doing things like this...
Demos

http://demos.dojotoolkit.org/demos/

Map data (in mobile)
  http://demos.dojotoolkit.org/demos/mobileGeoCharting/demo.html


Images
  http://demos.dojotoolkit.org/demos/cropper/demo.html


Widgets
  http://demos.dojotoolkit.org/demos/mail
Demo sites

 Stocker http://persevere.sitepen.com/stocker.html
   DataChart, data stores, events
 http://demos.dojotoolkit.org/demos/mail/
   Widgets: “The sort of thing we tend to use dojo for”
 http://demos.dojotoolkit.org/demos/castle/
   With a different look, Accordion widget, FishEye widget, some content panes
 http://demos.dojotoolkit.org/demos/flashCards/
    Timers, svg,
 http://sitepen.github.com/sp-dnd-demo/4-dnd.html
   Drag & Drop, Title panes
Or if your name is Bruce Lee

  What would be a real challenge?
  How could we prove that Rich Web Apps have
   arrived?


  Well, you could build a desktop environment...


  http://www.lucid-desktop.org/demo/


  http://localhost/lucid
60 mins of Dojo

 Live coding – start using dojo today
 How can you use dojo?
 How dojo is organized.
   Dojo core - dojo
   Widgets    - dijit
   Cool stuff - dojox
 Datastores & Dojo Grid
 Resources
Not covered in this talk

 Only summarizing what is in
   dojo core
   dijit
   dojox
 Won't go into detail
 Dojo tools: builds, DOH (unit testing)
 Dojo class structure and inheritance
 Touch of Death
Where is the Dojo?

 http://dojotoolkit.org


 Or for your html page
 <script src="
   http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js
 "></script>
dojo.js

 dojo.js 47kb


 or use async mode aka “dojo nano” 3.8kb


 Uncompressed for development
 dojo.js.uncompressed.js
 or download the source
 http://dojotoolkit.org/download/
Documentation

 Tutorials
 http://dojotoolkit.org/documentation/


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


 Reference Guide
 http://dojotoolkit.org/reference-guide/1.7/index.html
Live Coding Demo
2 Paths

Markup
djConfig=”parseOnLoad: true”
<div dojoType=”dijit.layout.TabContainer”/>


Javascript
var tc = new dijit.layout.TabContainer();
tc.startup();
Markup demo


              <div dojoType="dijit.layout.TabContainer"
                  style="width:80%; height: 500px">

              <div dojoType="dijit.layout.ContentPane"
                  title="dojo core">core here</div>

              <div dojoType="dijit.layout.ContentPane"
                  title="dijit"> great widgets</div>

              <div dojoType="dijit.layout.ContentPane"
                  title="dojox">#winning</div>

              </div>
Javascript demo
                  require(["dijit/layout/TabContainer",
                  "dijit/layout/ContentPane", "dojo/domReady!"],

                  function(TabContainer, ContentPane) {
                      var tc = new TabContainer({
                           style: "height: 500px; width: 80%;"
                           }, "iWishIWereTabbed");

                        var c = new ContentPane({
                             title: "Food",
                             content: "We offer amazing food"
                             });
                        tc.addChild(c);

                        var c2 = new ContentPane({
                             title: "Drinks",
                             content: "We have drinks."
                             });
                        tc.addChild(c2);

                        tc.startup();
                  });
About Dojo

 Started in 2004 as a project at Informatica
 Now is a 501(c)6, the Dojo Foundation


 Open Source: Choice of BSD or AFL


 Version 1.7.2
Who is Dojo

 Individuals: Anyone who signs a CLA can be a
   contributor.
 Including some who work for:
 Mozilla, IBM, Google, Oracle, PIXAR, Redhat...
 Companies can sign a company CLA for their employees who
  contribute to dojo.
 Dojo contains several contributed code bases: nWidgets,
  Burstlib, f(m), TurboGrid, Sizzle (from jQuery).

 Commercial support available from SitePen.
When / How to use Dojo

 Rich Internet Applications
   Desktop style and “One Page” apps


 Mixed Martial Arts
   use it alongside jQuery, YUI, etc


 Organize your javascript tangle with the dojo
  package system aka AMD aka require.js
With JQuery

They collaborate on CSS selector libraries that
 can be swapped in and out.


Many jQuery projects are hosted by the Dojo
 Foundation


JQuery compatiblity layer: run jQuery UI on dojo
With Node.js

Both use the same CommonsJS package
 management and Asynchronous Module
 Definitions (AMD) for loading.


Dojo can be run directly in node.js rather than in
 a browser to provide GUI components.


Dojo build system now uses node.js
In toolkits

dojotoolkit.org
  /features/integrations


Other projects    version


 GWT (Tatami)      1.3.2


 Grails plugin     1.7.2
For Minimalists

Async mode
  Fully asynchronous, run code when your require
   statement is done loading.


3.8kb
  Just require and define


Great for mobile or non dojo applications
Modules: Require and Define

 Namespace system
 require issues a request for the file. Files get
   cached like any http request.
 define(“dosug.examples.jackalope”);
 dojo.declare(“dosug.examples.jackalope”, null, {
   // body of new object
   });
 dojo.registerModulePath(“dosug”, “../dosug”);
Modules: file structure

File structure matches require statements


dojo/
dijit/
    layout/
              TabContainer.js
dojox/
Dojo core

 Basic Browser self Defense
   dojo.byId
   array indexOf


 DRY Lots of handy javascript functions
   isArray
   trim
   addClass
Dojo core

 World spanning power. Itty bitty living space
 effects
 events
 xhr (XmlHttpRequest)
 json
 dojo.query
 Browser detection
Dijit

 Widget library
 Accessible, Internationalizable
    High Contrast mode
    Gracefully degrade in older browsers
    Right to Left text
 dijit.form
 dijit.layout
Dijit: Themes

 Themes:
    Claro        blue
    Tundra     white
    Nihilo    most basic
    Soria      light yellow and orange?


 All are subtle, designed to work with existing look.
 Want something flashier? Easy to override, custom themes
  available on internet.
 No themeroller. jQuery wins this round.
Dojox

 “I know secret-kung-fu”
   Video / Graphics
   Charting
   RSS
   Advanced Datastores and Offline storage


 dojox.grid.DataGrid
 dojox.charting.DataChart
Datastores: dojo.data
Client side object to hold data
  Basically an array of items, with lots of functionality
   wrapped around it.


Support for many types of data
  Easiest way to start is with JSON
Datastores: JSON

 JavaScript Object Notation
 var myObject = {
   firstName: 'Gabe',
   lastName: 'Hamilton',
   favorite-color: 'blue... no, red' };


 var myArray =
   [ myObject, {firstName: 'Bob'}];
Datastores: dojo.data.api

 dojo.data.api defines basic operations
 Read
 Write
 Identity
 Notification
 ItemFileReadStore implements Read and
   Identity
 ServiceStore implements all 4
Datastores: dojox.data

 CSVStore
 XMLStore
 ServiceStore
   QueryReadStore
   JsonRestStore
   AtomReadStore
 ServiceStores based on public API
   Flickr, S3, Wikipedia, Google, Persevere, etc...
dojox.data.JsonRestStore

 var store = new dojox.data.JsonRestStore({
       target: "/users/",
       idAttribute: "id"
 });


 Put, Post, Delete, Get
  [ user: { name: Gabe, id: 1 },
       user: { name: Bob, id: 2 } ]
dojox.grid.DataGrid Demo
Other Resources


 http://www.slideshare.net/sitepen/top-ways-
   dojo-can-improve-your-mapping-app


 https://www.ibm.com/developerworks/mydevelo
   perworks/bookmarks/html?
   sort=date&tag=dojo&lang=en
Resources

 http://dojotoolkit.org
 http://dojotoolkit.org/documentation
 Great Examples
   http://livedocs.dojotoolkit.org/
   http://sitepen.com/blog/category/dojo


 Amazon search has 94 book results for dojo
  javascript of which the top 8 were books just
  on dojo.
Acknowlegements

Thanks to the photographers of the following Creative Commons
  pictures
http://commons.wikimedia.org/wiki/File:Zen_Dojo_Sarbacana1.jpg
http://commons.wikimedia.org/wiki/File:Demonstrating_Kung_Fu_at_Daxiangguo_Monestary,_Kaifeng,_

http://commons.wikimedia.org/wiki/File:Shadow_Karate_Kick.jpg
http://commons.wikimedia.org/wiki/File:Reloading_tools.jpg

http://commons.wikimedia.org/wiki/File:Grue_migration_Lake_Agmon_Hula_Valley.JPG
Questions


 gabehamilton@gmail.com
Dojo: Beautiful Web Apps, Fast

Contenu connexe

Tendances

ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMJonathan Wage
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMJonathan Wage
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperJonathan Wage
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo ToolkitThomas Koch
 
2017-06-22 Documentation as code
2017-06-22 Documentation as code2017-06-22 Documentation as code
2017-06-22 Documentation as codeJérémie Bresson
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDBMongoDB
 
Custom YUI Widgets
Custom YUI WidgetsCustom YUI Widgets
Custom YUI Widgetscyrildoussin
 
Intro to HTML5 Web Storage
Intro to HTML5 Web StorageIntro to HTML5 Web Storage
Intro to HTML5 Web Storagedylanks
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to resultNikolai Onken
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196Mahmoud Samir Fayed
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
Prerendering Chapter 0
Prerendering Chapter 0Prerendering Chapter 0
Prerendering Chapter 0Samael Wang
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocratlinoj
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDBVyacheslav
 
Prerendering: Revisit
Prerendering: RevisitPrerendering: Revisit
Prerendering: RevisitSamael Wang
 
San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Groupkchodorow
 
Qtp Imp Script Examples
Qtp Imp Script ExamplesQtp Imp Script Examples
Qtp Imp Script ExamplesUser1test
 

Tendances (20)

ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo Toolkit
 
2017-06-22 Documentation as code
2017-06-22 Documentation as code2017-06-22 Documentation as code
2017-06-22 Documentation as code
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
Custom YUI Widgets
Custom YUI WidgetsCustom YUI Widgets
Custom YUI Widgets
 
Intro to HTML5 Web Storage
Intro to HTML5 Web StorageIntro to HTML5 Web Storage
Intro to HTML5 Web Storage
 
Dojo, from scratch to result
Dojo, from scratch to resultDojo, from scratch to result
Dojo, from scratch to result
 
The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196The Ring programming language version 1.7 book - Part 47 of 196
The Ring programming language version 1.7 book - Part 47 of 196
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
Prerendering Chapter 0
Prerendering Chapter 0Prerendering Chapter 0
Prerendering Chapter 0
 
12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat12 core technologies you should learn, love, and hate to be a 'real' technocrat
12 core technologies you should learn, love, and hate to be a 'real' technocrat
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
 
Prerendering: Revisit
Prerendering: RevisitPrerendering: Revisit
Prerendering: Revisit
 
Scripting The Dom
Scripting The DomScripting The Dom
Scripting The Dom
 
San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Group
 
Qtp Imp Script Examples
Qtp Imp Script ExamplesQtp Imp Script Examples
Qtp Imp Script Examples
 
Indexing
IndexingIndexing
Indexing
 

Similaire à Dojo: Beautiful Web Apps, Fast

Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started TodayGabriel Hamilton
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit Predhin Sapru
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipeilittlebtc
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for youSimon Willison
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPnsandonato
 
MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichunglittlebtc
 
Tweetirc presentation
Tweetirc presentationTweetirc presentation
Tweetirc presentationJosé Moreira
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Peter Martin
 

Similaire à Dojo: Beautiful Web Apps, Fast (20)

Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started Today
 
Dojo tutorial
Dojo tutorialDojo tutorial
Dojo tutorial
 
Test02
Test02Test02
Test02
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Dojo javascript toolkit
Dojo javascript toolkit Dojo javascript toolkit
Dojo javascript toolkit
 
Using Dojo
Using DojoUsing Dojo
Using Dojo
 
my test
my testmy test
my test
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipei
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
DOJO
DOJO DOJO
DOJO
 
Ria with dojo
Ria with dojoRia with dojo
Ria with dojo
 
How to make Ajax Libraries work for you
How to make Ajax Libraries work for youHow to make Ajax Libraries work for you
How to make Ajax Libraries work for you
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
 
MozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: TaichungMozTW Jetpack Workshop: Taichung
MozTW Jetpack Workshop: Taichung
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Tweetirc presentation
Tweetirc presentationTweetirc presentation
Tweetirc presentation
 
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 

Plus de Gabriel Hamilton

Javascript Smart Contracts on NEAR
Javascript Smart Contracts on NEARJavascript Smart Contracts on NEAR
Javascript Smart Contracts on NEARGabriel Hamilton
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extractionGabriel Hamilton
 
Software engineering for CEOs
Software engineering for CEOsSoftware engineering for CEOs
Software engineering for CEOsGabriel Hamilton
 
Adaptive software engineering
Adaptive software engineeringAdaptive software engineering
Adaptive software engineeringGabriel Hamilton
 
The TensorFlow dance craze
The TensorFlow dance crazeThe TensorFlow dance craze
The TensorFlow dance crazeGabriel Hamilton
 
Software engineering for CEOs ch1
Software engineering for CEOs ch1Software engineering for CEOs ch1
Software engineering for CEOs ch1Gabriel Hamilton
 
DOSUG Intro to google prediction api
DOSUG Intro to google prediction apiDOSUG Intro to google prediction api
DOSUG Intro to google prediction apiGabriel Hamilton
 
How BigQuery broke my heart
How BigQuery broke my heartHow BigQuery broke my heart
How BigQuery broke my heartGabriel Hamilton
 
How to present lots of information on a screen
How to present lots of information on a screenHow to present lots of information on a screen
How to present lots of information on a screenGabriel Hamilton
 
Intro to Google Prediction API
Intro to Google Prediction APIIntro to Google Prediction API
Intro to Google Prediction APIGabriel Hamilton
 

Plus de Gabriel Hamilton (14)

Javascript Smart Contracts on NEAR
Javascript Smart Contracts on NEARJavascript Smart Contracts on NEAR
Javascript Smart Contracts on NEAR
 
Smart Contracts
Smart ContractsSmart Contracts
Smart Contracts
 
Web Next
Web NextWeb Next
Web Next
 
Beyond Agile Software
Beyond Agile SoftwareBeyond Agile Software
Beyond Agile Software
 
Natural language processing: feature extraction
Natural language processing: feature extractionNatural language processing: feature extraction
Natural language processing: feature extraction
 
Software engineering for CEOs
Software engineering for CEOsSoftware engineering for CEOs
Software engineering for CEOs
 
Adaptive software engineering
Adaptive software engineeringAdaptive software engineering
Adaptive software engineering
 
The TensorFlow dance craze
The TensorFlow dance crazeThe TensorFlow dance craze
The TensorFlow dance craze
 
DataFlow & Beam
DataFlow & BeamDataFlow & Beam
DataFlow & Beam
 
Software engineering for CEOs ch1
Software engineering for CEOs ch1Software engineering for CEOs ch1
Software engineering for CEOs ch1
 
DOSUG Intro to google prediction api
DOSUG Intro to google prediction apiDOSUG Intro to google prediction api
DOSUG Intro to google prediction api
 
How BigQuery broke my heart
How BigQuery broke my heartHow BigQuery broke my heart
How BigQuery broke my heart
 
How to present lots of information on a screen
How to present lots of information on a screenHow to present lots of information on a screen
How to present lots of information on a screen
 
Intro to Google Prediction API
Intro to Google Prediction APIIntro to Google Prediction API
Intro to Google Prediction API
 

Dernier

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Dernier (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Dojo: Beautiful Web Apps, Fast

  • 1. Dojo: Beautiful Web Apps, Fast Gabe Hamilton Updated for dojo 1.7.2
  • 2. Gabe Hamilton Web Developer: Grails, Java, C#, others For the past 10 years that has meant a lot of javascript. Send your dojo questions to gabehamilton@gmail.com
  • 3. What is Dojo? A javascript toolkit For doing things like this...
  • 4. Demos http://demos.dojotoolkit.org/demos/ Map data (in mobile) http://demos.dojotoolkit.org/demos/mobileGeoCharting/demo.html Images http://demos.dojotoolkit.org/demos/cropper/demo.html Widgets http://demos.dojotoolkit.org/demos/mail
  • 5. Demo sites Stocker http://persevere.sitepen.com/stocker.html DataChart, data stores, events http://demos.dojotoolkit.org/demos/mail/ Widgets: “The sort of thing we tend to use dojo for” http://demos.dojotoolkit.org/demos/castle/ With a different look, Accordion widget, FishEye widget, some content panes http://demos.dojotoolkit.org/demos/flashCards/ Timers, svg, http://sitepen.github.com/sp-dnd-demo/4-dnd.html Drag & Drop, Title panes
  • 6. Or if your name is Bruce Lee What would be a real challenge? How could we prove that Rich Web Apps have arrived? Well, you could build a desktop environment... http://www.lucid-desktop.org/demo/ http://localhost/lucid
  • 7. 60 mins of Dojo Live coding – start using dojo today How can you use dojo? How dojo is organized. Dojo core - dojo Widgets - dijit Cool stuff - dojox Datastores & Dojo Grid Resources
  • 8. Not covered in this talk Only summarizing what is in dojo core dijit dojox Won't go into detail Dojo tools: builds, DOH (unit testing) Dojo class structure and inheritance Touch of Death
  • 9. Where is the Dojo? http://dojotoolkit.org Or for your html page <script src=" http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js "></script>
  • 10. dojo.js dojo.js 47kb or use async mode aka “dojo nano” 3.8kb Uncompressed for development dojo.js.uncompressed.js or download the source http://dojotoolkit.org/download/
  • 11. Documentation Tutorials http://dojotoolkit.org/documentation/ API docs http://dojotoolkit.org/api/ Reference Guide http://dojotoolkit.org/reference-guide/1.7/index.html
  • 13. 2 Paths Markup djConfig=”parseOnLoad: true” <div dojoType=”dijit.layout.TabContainer”/> Javascript var tc = new dijit.layout.TabContainer(); tc.startup();
  • 14. Markup demo <div dojoType="dijit.layout.TabContainer" style="width:80%; height: 500px"> <div dojoType="dijit.layout.ContentPane" title="dojo core">core here</div> <div dojoType="dijit.layout.ContentPane" title="dijit"> great widgets</div> <div dojoType="dijit.layout.ContentPane" title="dojox">#winning</div> </div>
  • 15. Javascript demo require(["dijit/layout/TabContainer", "dijit/layout/ContentPane", "dojo/domReady!"], function(TabContainer, ContentPane) { var tc = new TabContainer({ style: "height: 500px; width: 80%;" }, "iWishIWereTabbed"); var c = new ContentPane({ title: "Food", content: "We offer amazing food" }); tc.addChild(c); var c2 = new ContentPane({ title: "Drinks", content: "We have drinks." }); tc.addChild(c2); tc.startup(); });
  • 16. About Dojo Started in 2004 as a project at Informatica Now is a 501(c)6, the Dojo Foundation Open Source: Choice of BSD or AFL Version 1.7.2
  • 17. Who is Dojo Individuals: Anyone who signs a CLA can be a contributor. Including some who work for: Mozilla, IBM, Google, Oracle, PIXAR, Redhat... Companies can sign a company CLA for their employees who contribute to dojo. Dojo contains several contributed code bases: nWidgets, Burstlib, f(m), TurboGrid, Sizzle (from jQuery). Commercial support available from SitePen.
  • 18. When / How to use Dojo Rich Internet Applications Desktop style and “One Page” apps Mixed Martial Arts use it alongside jQuery, YUI, etc Organize your javascript tangle with the dojo package system aka AMD aka require.js
  • 19. With JQuery They collaborate on CSS selector libraries that can be swapped in and out. Many jQuery projects are hosted by the Dojo Foundation JQuery compatiblity layer: run jQuery UI on dojo
  • 20. With Node.js Both use the same CommonsJS package management and Asynchronous Module Definitions (AMD) for loading. Dojo can be run directly in node.js rather than in a browser to provide GUI components. Dojo build system now uses node.js
  • 21. In toolkits dojotoolkit.org /features/integrations Other projects version GWT (Tatami) 1.3.2 Grails plugin 1.7.2
  • 22. For Minimalists Async mode Fully asynchronous, run code when your require statement is done loading. 3.8kb Just require and define Great for mobile or non dojo applications
  • 23. Modules: Require and Define Namespace system require issues a request for the file. Files get cached like any http request. define(“dosug.examples.jackalope”); dojo.declare(“dosug.examples.jackalope”, null, { // body of new object }); dojo.registerModulePath(“dosug”, “../dosug”);
  • 24. Modules: file structure File structure matches require statements dojo/ dijit/ layout/ TabContainer.js dojox/
  • 25. Dojo core Basic Browser self Defense dojo.byId array indexOf DRY Lots of handy javascript functions isArray trim addClass
  • 26. Dojo core World spanning power. Itty bitty living space effects events xhr (XmlHttpRequest) json dojo.query Browser detection
  • 27. Dijit Widget library Accessible, Internationalizable High Contrast mode Gracefully degrade in older browsers Right to Left text dijit.form dijit.layout
  • 28. Dijit: Themes Themes: Claro blue Tundra white Nihilo most basic Soria light yellow and orange? All are subtle, designed to work with existing look. Want something flashier? Easy to override, custom themes available on internet. No themeroller. jQuery wins this round.
  • 29. Dojox “I know secret-kung-fu” Video / Graphics Charting RSS Advanced Datastores and Offline storage dojox.grid.DataGrid dojox.charting.DataChart
  • 30. Datastores: dojo.data Client side object to hold data Basically an array of items, with lots of functionality wrapped around it. Support for many types of data Easiest way to start is with JSON
  • 31. Datastores: JSON JavaScript Object Notation var myObject = { firstName: 'Gabe', lastName: 'Hamilton', favorite-color: 'blue... no, red' }; var myArray = [ myObject, {firstName: 'Bob'}];
  • 32. Datastores: dojo.data.api dojo.data.api defines basic operations Read Write Identity Notification ItemFileReadStore implements Read and Identity ServiceStore implements all 4
  • 33. Datastores: dojox.data CSVStore XMLStore ServiceStore QueryReadStore JsonRestStore AtomReadStore ServiceStores based on public API Flickr, S3, Wikipedia, Google, Persevere, etc...
  • 34. dojox.data.JsonRestStore var store = new dojox.data.JsonRestStore({ target: "/users/", idAttribute: "id" }); Put, Post, Delete, Get [ user: { name: Gabe, id: 1 }, user: { name: Bob, id: 2 } ]
  • 36. Other Resources http://www.slideshare.net/sitepen/top-ways- dojo-can-improve-your-mapping-app https://www.ibm.com/developerworks/mydevelo perworks/bookmarks/html? sort=date&tag=dojo&lang=en
  • 37. Resources http://dojotoolkit.org http://dojotoolkit.org/documentation Great Examples http://livedocs.dojotoolkit.org/ http://sitepen.com/blog/category/dojo Amazon search has 94 book results for dojo javascript of which the top 8 were books just on dojo.
  • 38. Acknowlegements Thanks to the photographers of the following Creative Commons pictures http://commons.wikimedia.org/wiki/File:Zen_Dojo_Sarbacana1.jpg http://commons.wikimedia.org/wiki/File:Demonstrating_Kung_Fu_at_Daxiangguo_Monestary,_Kaifeng,_ http://commons.wikimedia.org/wiki/File:Shadow_Karate_Kick.jpg http://commons.wikimedia.org/wiki/File:Reloading_tools.jpg http://commons.wikimedia.org/wiki/File:Grue_migration_Lake_Agmon_Hula_Valley.JPG