SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Dojo Confessions
Rebecca Murphey @rmurphey Developer Day 2010, Durham, NC
2007                                                         I
                                                           jQuer
                                                                 y!


“Youʼll wonder why
you ever considered
another library.”
– “Choosing jQuery,” blog.rebeccamurphey.com, December 3, 2007
+   +
2009
Classes & Inheritance
Abstract APIs
for Common Tasks
“Templating makes your
              life so much
       ${yourStringHere}!”



Templates + Caching
+ String Interning
Consistency
across Components
Dependency
Management &
Build Tools
Backcompat Guarantee
Room to Grow
B u t I
       u e ry!!1 !
    jQ
DISCLAIMER: This presentation contains a comparison of toys. In the pursuit of fairness, we have
included only toys that are members of the Toy Hall of Fame. The following slides are not meant to
disparage or celebrate any particular toy in any particular way. No JavaScript libraries have been hurt
in the performance of this presentation. We hope.
jQuery
Dojo
$(function(){
    loadImages("interesting");

      $("#sidebar h1").click(function(){
          setTag(this);
      });

      $("a#addlist").click(function(){
          this.blur();
          var tagname = prompt("Enter a tag to search Flickr for photos.","");
          if (!tagname) return;
          $("div#sidebar")
              .append("<h1>"+tagname+"</h1>")
              .find("h1:last-child")
                  .click(function(){
                       setTag(this);
                  });
          setTag($("div#sidebar h1:last-child"));
      });

      $("a#removelist").click(function(){



                                 jQuery: Node-focused
          this.blur();
          if ($("div#sidebar h1.active").text() == "Interesting Photos") return;
          $("div#sidebar h1.active").remove();
          setTag($("div#sidebar h1:last-child"));
      });
});

function loadImages(tag){
    $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags="+tag
+"&tagmode=any&format=json&jsoncallback=?", function(data){
        $.each(data.items, function(i,item){
            img = new Image();
            img.src = item.media.m;
dojo.provide('Flickr.SearchTerm');

dojo.require('dijit._Widget');
dojo.require('dijit._Templated');
dojo.require('dojox.data.FlickrRestStore');

dojo.declare('Flickr.SearchTerm', [ dijit._Widget, dijit._Templated ], {
    templateString : '<h1>${term}</h1>',
    store : new dojox.data.FlickrRestStore(),

    constructor : function(config) {
        this.term = config.term;
    },

    postCreate : function() {
        // listen for instructions to show the term
        d.subscribe('/term/show', this, '_show');

         // send instructions to show the term when clicked
         this.connect(this.domNode, 'click', function() {
             d.publish('/term/show', [ this.term ]);



                 Dojo: Component-focused
         });
    },

    _show : function(term) {
        // we can receive /term/show messages from any SearchTerm.
        // look to see if this one is related to this SearchTerm;

         // if not, set this SearchTerm as inactive
         if (term != this.term) {
             this.active = false;
             dojo.removeClass(this.domNode, 'active');
             return;
omg wtf?
“It’s just JavaScript.”
– Peter Higgins, Dojo project lead
• dflick: evolving flickr tag search fun
• transformers: pub/sub deathmatch
I STI
               LL
          jQuer
                y!




Tell me more!
• twitterverse example app (github.com/
  phiggins42/twitterverse/)


• Dojo: The Definitive Guide (OʼReilly)
• docs.dojocampus.org
• api.dojotoolkit.org
• the code!
jQ ue  ry
I
    EVER !!1!
  4
• JavaScript MVC (esp. Controller)
• Custom events
• jQuery pub/sub

• pinboard.in/u:rmurphey/t:code-org/
Thanks.



www.rebeccamurphey.com
@rmurphey
http://pinboard.in/u:rmurphey/t:dojo/

Weitere ähnliche Inhalte

Was ist angesagt?

jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
dmethvin
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
Md. Ziaul Haq
 

Was ist angesagt? (20)

How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Matters of State
Matters of StateMatters of State
Matters of State
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
Organizing Code with JavascriptMVC
Organizing Code with JavascriptMVCOrganizing Code with JavascriptMVC
Organizing Code with JavascriptMVC
 
Javascript in Plone
Javascript in PloneJavascript in Plone
Javascript in Plone
 
Jquery
JqueryJquery
Jquery
 
How kris-writes-symfony-apps-london
How kris-writes-symfony-apps-londonHow kris-writes-symfony-apps-london
How kris-writes-symfony-apps-london
 
Jquery plugin development
Jquery plugin developmentJquery plugin development
Jquery plugin development
 
jQuery
jQueryjQuery
jQuery
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
jQuery Namespace Pattern
jQuery Namespace PatternjQuery Namespace Pattern
jQuery Namespace Pattern
 
Kick start with j query
Kick start with j queryKick start with j query
Kick start with j query
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
 
jQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, Ajax
 

Ähnlich wie Dojo Confessions

Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3
luckysb16
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
girish82
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
Jarod Ferguson
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
smueller_sandsmedia
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
David Giard
 

Ähnlich wie Dojo Confessions (20)

J query
J queryJ query
J query
 
Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3Learning jquery-in-30-minutes-1195942580702664-3
Learning jquery-in-30-minutes-1195942580702664-3
 
Jquery
JqueryJquery
Jquery
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
JavaScript!
JavaScript!JavaScript!
JavaScript!
 
jQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't KnowjQuery - 10 Time-Savers You (Maybe) Don't Know
jQuery - 10 Time-Savers You (Maybe) Don't Know
 
J queryui
J queryuiJ queryui
J queryui
 
Beginning jQuery
Beginning jQueryBeginning jQuery
Beginning jQuery
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
bcgr3-jquery
bcgr3-jquerybcgr3-jquery
bcgr3-jquery
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
Taming that client side mess with Backbone.js
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
 
international PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secrets
 
jQuery Loves You
jQuery Loves YoujQuery Loves You
jQuery Loves You
 
How to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQueryHow to increase Performance of Web Application using JQuery
How to increase Performance of Web Application using JQuery
 
J query1
J query1J query1
J query1
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
 
jQuery for web development
jQuery for web developmentjQuery for web development
jQuery for web development
 

Mehr von Rebecca Murphey (9)

Getting Started with Mulberry
Getting Started with MulberryGetting Started with Mulberry
Getting Started with Mulberry
 
Introducing Mulberry
Introducing MulberryIntroducing Mulberry
Introducing Mulberry
 
DojoConf: Building Large Apps
DojoConf: Building Large AppsDojoConf: Building Large Apps
DojoConf: Building Large Apps
 
Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gotham
 
Lessons from a Rewrite
Lessons from a RewriteLessons from a Rewrite
Lessons from a Rewrite
 
Modern JavaScript
Modern JavaScriptModern JavaScript
Modern JavaScript
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Dojo Confessions

  • 1. Dojo Confessions Rebecca Murphey @rmurphey Developer Day 2010, Durham, NC
  • 2.
  • 3. 2007 I jQuer y! “Youʼll wonder why you ever considered another library.” – “Choosing jQuery,” blog.rebeccamurphey.com, December 3, 2007
  • 4. + +
  • 8. “Templating makes your life so much ${yourStringHere}!” Templates + Caching + String Interning
  • 13. B u t I u e ry!!1 ! jQ DISCLAIMER: This presentation contains a comparison of toys. In the pursuit of fairness, we have included only toys that are members of the Toy Hall of Fame. The following slides are not meant to disparage or celebrate any particular toy in any particular way. No JavaScript libraries have been hurt in the performance of this presentation. We hope.
  • 15.
  • 16. Dojo
  • 17.
  • 18. $(function(){ loadImages("interesting"); $("#sidebar h1").click(function(){ setTag(this); }); $("a#addlist").click(function(){ this.blur(); var tagname = prompt("Enter a tag to search Flickr for photos.",""); if (!tagname) return; $("div#sidebar") .append("<h1>"+tagname+"</h1>") .find("h1:last-child") .click(function(){ setTag(this); }); setTag($("div#sidebar h1:last-child")); }); $("a#removelist").click(function(){ jQuery: Node-focused this.blur(); if ($("div#sidebar h1.active").text() == "Interesting Photos") return; $("div#sidebar h1.active").remove(); setTag($("div#sidebar h1:last-child")); }); }); function loadImages(tag){ $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags="+tag +"&tagmode=any&format=json&jsoncallback=?", function(data){ $.each(data.items, function(i,item){ img = new Image(); img.src = item.media.m;
  • 19. dojo.provide('Flickr.SearchTerm'); dojo.require('dijit._Widget'); dojo.require('dijit._Templated'); dojo.require('dojox.data.FlickrRestStore'); dojo.declare('Flickr.SearchTerm', [ dijit._Widget, dijit._Templated ], { templateString : '<h1>${term}</h1>', store : new dojox.data.FlickrRestStore(), constructor : function(config) { this.term = config.term; }, postCreate : function() { // listen for instructions to show the term d.subscribe('/term/show', this, '_show'); // send instructions to show the term when clicked this.connect(this.domNode, 'click', function() { d.publish('/term/show', [ this.term ]); Dojo: Component-focused }); }, _show : function(term) { // we can receive /term/show messages from any SearchTerm. // look to see if this one is related to this SearchTerm; // if not, set this SearchTerm as inactive if (term != this.term) { this.active = false; dojo.removeClass(this.domNode, 'active'); return;
  • 21. “It’s just JavaScript.” – Peter Higgins, Dojo project lead
  • 22. • dflick: evolving flickr tag search fun • transformers: pub/sub deathmatch
  • 23. I STI LL jQuer y! Tell me more!
  • 24. • twitterverse example app (github.com/ phiggins42/twitterverse/) • Dojo: The Definitive Guide (OʼReilly) • docs.dojocampus.org • api.dojotoolkit.org • the code!
  • 25. jQ ue ry I EVER !!1! 4
  • 26. • JavaScript MVC (esp. Controller) • Custom events • jQuery pub/sub • pinboard.in/u:rmurphey/t:code-org/