SlideShare a Scribd company logo
Dojo – from web page to web application Yoav Rubin, IBM Research – Haifa, yoav@il.ibm.com
What is a web application
What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application    has data, algorithms, APIs Accessed    the application itself can be accessed by anyone  Web browser    Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network    there is a need to minimize what’s being communicated
How does Dojo relates to it
What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application    has data, algorithms, APIs Accessed    the application itself can be accessed by anyone   Web browser    Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network    there is a need to minimize what’s being communicated
Dojo.data A data access layer Hides underlying data structures and formats  set of APIs/interfaces for writing data stores Unique way to handle data with widgets
The general architecture
Dojo.data translated to en-db SQL Select request JDBC or ODBC Dojo.data.api WHERE cause Query Primary key Identity Foreign key Reference -- Value Column Attribute Row Item Database Data source Cursor Datastore Database Term Dojo.data
Dojo.data – available stores  ItemFileReadStore and ItemFileWriteStore Would map to your DB on your server Several general purpose stores (found in dojox.data): CsvStore ServiceStore XmlStore OpmlStore JsonRestStore JsonQueryStore
But there are other kinds of possible data sources / applications
Getting the data from other web applications Found in dojox.data Wikipedia WikipediaStore Google search GoogleSearchStore Google feed GoogleFeedStore Picasa PicasaStore Flickr FlickrRestStore S3 S3Store
Getting data of your client side  HtmlTableStore Data found in a table in your application CssClassStore Data about the css classes used within your application (read only) CssRuleStore Data about the css rules (read only)
Presenting the data in a grid – dojox.grid.DataGrid Dynamic and editable data views Sortable and resizeable columns Data driven backing store Filtering Dynamic loading In-place editing Sub-grids Sub-views (Column locking) ‏ Fast virtual vertical scrolling Cell formatters to isolate content from layout
dojox.grid.DataGrid
Presenting the data in a tree – dijit.Tree DataStore driven, model backed Drag and Drop branches Forest support (hidden root) Custom icons for branches and leafs
What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application    has data, algorithms, APIs Accessed    the application itself can be accessed by anyone  Web browser    Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network    there is a need to minimize what’s being communicated
What do we know about our users – nothing What can we assume about our users – even less then that
Users diversity They use different browsers, with different versions They have different mother tongue language They may have disabilities How does a colorblind person sees my application Will my application cause a seizure to an epileptic person There are even user that prefer to use the keyboard over the mouse Remember all these vi / emacs users
What does dojo supports Browsers User’s locale can be determined by the application’s user, and defaults to the locale defined upon browser installation Localization Based on the user’s locale Parsing Presentation  Number, currency, date, time Internationalization Dojo fetches the right string and messages (a.k.a resource bundle) based on the user’s locale Accessibility Keyboard navigation High contrast mode WAI roles and states
What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application    has data, algorithms, APIs Accessed    the application itself can be accessed by anyone   Web browser    Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network    there is a need to minimize what’s being communicated
 
The skill set of client side development is very different from the skill set of server side development  Technologies Html, css, JavaScript, dom, flash/flex Platforms Browsers, devices Soft skills Usability, visual design Performance Network, runtime Other considerations Internationalization, accessibility  Technologies Java/ C# , PHP Platforms Servers, OS Soft skills Multi threading, deployment configuration Performance Connections, compilation optimizations Other considerations Security,  portability Each of these skills carries a baggage: tools, methodologies, protocols, testing etc.
Templating Templating is automatic generation of code The generator accepts Data  Generation template – a description how to transform data to code Need to have a good understanding of the generated code in order to create a good template Client  side code generation is usually done on the  server  side, mixed with server side code Think of servlets / JSP / ASP / PHP
Dojox.dtl – client side template engine A client side template engine Client side code generation as part of client side code What do we get by moving the engine to the client side Server side developer develop server side code Client side developer develop client side code Only the data is sent over the network Based on the Django Templating Language
Dojox.dtl – client side template engine The generation engine uses:  The input data is the widget’s object  Generation template is the widget’s template The generation engine creates an html code Transformed to DOM object DOM optimizations handled by the engine creators  Results eventually in the way that the widget is presented by the browser
Dojox.dtl – What can you write there Loops Conditional execution (if-else) Variables Predefined (e.g., a loop’s counter) User defined Knows how to work with dojo’s constructs AttachPoints, AttachEvents, Nested widgets
<ul> {%   for  item  in  itemsData  %} <li class=&quot;collection-row- {{ forloop.counter|divisibleby:&quot;2&quot;   }} &quot; dojoAttachEvent=&quot;onmouseover:onMouseOver,onmouseout:onMouseOut&quot; itemIndex=&quot; {{  forloop.counter  }} &quot;> <span> <a href=&quot;javascript:void(0)&quot;> {{  item.name  }} </a> </span> <span><img src=&quot;/images/ {{  item.state  }} -icon.gif&quot;></span> </li> {% endfor %} </ul>
Dojox.dtl – when to use A widget that suppose to present model backed information that is determined on runtime Especially when the data is structured and repeating Combine with data stores to get great result with very little code
What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application    has data, algorithms, APIs Accessed    the application itself can be accessed by anyone   Web browser    Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network    there is a need to minimize what’s being communicated
Web application communication scheme (for Ajax application) Client (Browser) Server Cacheable, heavy weighted, Once Non-cacheable, light weighted, Many times Bring me the application Application (.html, .js, .css, icons) Bring me some data Data (xml / json) Take some data Ack
How to handle the heavy weight stuff Make it less heavy (shrink it) Thus have a faster loading time Decrease the number of resources that travel over the network Each request comes along with a performance hit payload Less required resources    less requests    less time Cache as much as possible    only the first access to the application is slow
Dojo build system Minification of files using Shirnksafe Reduces whitespaces Removes comments Shortens variable names Merging of files to make a layer, which is a merge of several files needed to provide a closed functionality Based on the dojo.require call, build a dependency list and merge all of the files in that list Inline template of widgets into the .js file
How to handle the light weighted stuff Make it even lighter Reduce the processing done in the browser for each such interaction Use Json Pros: very efficient and smaller in size (when compared to XML) Cons: Can’t be protocolized (as oppose to XML schema) Agreed upon structure Verifiable contents
Dojo to the rescue – dojox.json.schema A schema based on a definition found in json-schema.org Which was already implemented in JavaScript, Java, PHP, Python, Prel, Ruby, .Net etc.  Defines a way to protocolize Json objects Dojox.json.schema.Validate Accepts a schema as an argument Accepts a Json object as an argument Performs validation
References http://www.dojotoolkit.org http://dojocampus.org http://www.slideshare.net/klipstein/dojodata-stores-and-widgets http://groups.google.com/group/json-schema/web/json-schema-implementations?pli =1

More Related Content

PDF
Building Real-World Dojo Web Applications
PDF
Rich internet application development using the dojo toolkit
PPTX
Dojo tutorial
PDF
Complete Dojo
PPT
The Dojo Toolkit An Introduction
KEY
Dojo & HTML5
PPTX
Dojo javascript toolkit
PPT
HTML5: An Introduction To Next Generation Web Development
Building Real-World Dojo Web Applications
Rich internet application development using the dojo toolkit
Dojo tutorial
Complete Dojo
The Dojo Toolkit An Introduction
Dojo & HTML5
Dojo javascript toolkit
HTML5: An Introduction To Next Generation Web Development

What's hot (20)

PPTX
dmBridge & dmMonocle
PPSX
Rendering engine
ODP
Html5
PDF
HTML5: the new frontier of the web
PPTX
The web as it should be
PDF
Nuxeo WebEngine: a practical introduction
PDF
Understanding Webkit Rendering
PDF
Web Services PHP Tutorial
PDF
Wt unit 1 ppts web development process
PDF
Modern development paradigms
PPTX
Building Rich Internet Applications with Ext JS
PDF
PDF
Apache Cordova 4.x
PDF
JavaScript Libraries (Ajax Exp 2006)
PDF
Python - A Comprehensive Programming Language
PDF
Chrome Internals: Paint and Composition
PDF
jQuery: The World's Most Popular JavaScript Library Comes to XPages
PDF
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
PPT
Asp.net
PDF
Architecture of the Web browser
dmBridge & dmMonocle
Rendering engine
Html5
HTML5: the new frontier of the web
The web as it should be
Nuxeo WebEngine: a practical introduction
Understanding Webkit Rendering
Web Services PHP Tutorial
Wt unit 1 ppts web development process
Modern development paradigms
Building Rich Internet Applications with Ext JS
Apache Cordova 4.x
JavaScript Libraries (Ajax Exp 2006)
Python - A Comprehensive Programming Language
Chrome Internals: Paint and Composition
jQuery: The World's Most Popular JavaScript Library Comes to XPages
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
Asp.net
Architecture of the Web browser
Ad

Similar to Dojo - from web page to web apps (20)

PPT
Introduction To Dojo
PDF
JavaScript Library Overview
PPTX
How dojo works
PDF
JavaScript Libraries (Kings of Code)
PDF
JavaScript Libraries (@Media)
PPTX
Jquery dojo slides
PDF
Dojo (QCon 2007 Slides)
ODP
Dojo: Beautiful Web Apps, Fast
KEY
10 Years of JavaScript
KEY
Real-world Dojo Mobile
PPT
Building Multi-Channel Data-Aware Applications
PDF
JavaScript Library Overview
PDF
JavaScript Library Overview (Ajax Exp West 2007)
PDF
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
PDF
Getting Started with Dojo Toolkit
PDF
dojo.Patterns
ODP
Dojo: Getting Started Today
PDF
Dojo CRUD Components
PDF
Practical Thin Server Architecture With Dojo Peter Svensson
PDF
How to make Ajax Libraries work for you
Introduction To Dojo
JavaScript Library Overview
How dojo works
JavaScript Libraries (Kings of Code)
JavaScript Libraries (@Media)
Jquery dojo slides
Dojo (QCon 2007 Slides)
Dojo: Beautiful Web Apps, Fast
10 Years of JavaScript
Real-world Dojo Mobile
Building Multi-Channel Data-Aware Applications
JavaScript Library Overview
JavaScript Library Overview (Ajax Exp West 2007)
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Getting Started with Dojo Toolkit
dojo.Patterns
Dojo: Getting Started Today
Dojo CRUD Components
Practical Thin Server Architecture With Dojo Peter Svensson
How to make Ajax Libraries work for you
Ad

More from yoavrubin (6)

PPTX
CR17 - Designing a database like an archaeologist
PPTX
Designing a database like an archaeologist
PPTX
Functional Programming in Javascript - IL Tech Talks week
PPT
Clojure's take on concurrency
PPT
Functional OOP, Clojure style
PPT
JavaScript - Programming Languages course
CR17 - Designing a database like an archaeologist
Designing a database like an archaeologist
Functional Programming in Javascript - IL Tech Talks week
Clojure's take on concurrency
Functional OOP, Clojure style
JavaScript - Programming Languages course

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Modernizing your data center with Dell and AMD
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
NewMind AI Monthly Chronicles - July 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
Modernizing your data center with Dell and AMD
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx

Dojo - from web page to web apps

  • 1. Dojo – from web page to web application Yoav Rubin, IBM Research – Haifa, yoav@il.ibm.com
  • 2. What is a web application
  • 3. What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application  has data, algorithms, APIs Accessed  the application itself can be accessed by anyone Web browser  Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network  there is a need to minimize what’s being communicated
  • 4. How does Dojo relates to it
  • 5. What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application  has data, algorithms, APIs Accessed  the application itself can be accessed by anyone Web browser  Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network  there is a need to minimize what’s being communicated
  • 6. Dojo.data A data access layer Hides underlying data structures and formats  set of APIs/interfaces for writing data stores Unique way to handle data with widgets
  • 8. Dojo.data translated to en-db SQL Select request JDBC or ODBC Dojo.data.api WHERE cause Query Primary key Identity Foreign key Reference -- Value Column Attribute Row Item Database Data source Cursor Datastore Database Term Dojo.data
  • 9. Dojo.data – available stores ItemFileReadStore and ItemFileWriteStore Would map to your DB on your server Several general purpose stores (found in dojox.data): CsvStore ServiceStore XmlStore OpmlStore JsonRestStore JsonQueryStore
  • 10. But there are other kinds of possible data sources / applications
  • 11. Getting the data from other web applications Found in dojox.data Wikipedia WikipediaStore Google search GoogleSearchStore Google feed GoogleFeedStore Picasa PicasaStore Flickr FlickrRestStore S3 S3Store
  • 12. Getting data of your client side HtmlTableStore Data found in a table in your application CssClassStore Data about the css classes used within your application (read only) CssRuleStore Data about the css rules (read only)
  • 13. Presenting the data in a grid – dojox.grid.DataGrid Dynamic and editable data views Sortable and resizeable columns Data driven backing store Filtering Dynamic loading In-place editing Sub-grids Sub-views (Column locking) ‏ Fast virtual vertical scrolling Cell formatters to isolate content from layout
  • 15. Presenting the data in a tree – dijit.Tree DataStore driven, model backed Drag and Drop branches Forest support (hidden root) Custom icons for branches and leafs
  • 16. What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application  has data, algorithms, APIs Accessed  the application itself can be accessed by anyone Web browser  Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network  there is a need to minimize what’s being communicated
  • 17. What do we know about our users – nothing What can we assume about our users – even less then that
  • 18. Users diversity They use different browsers, with different versions They have different mother tongue language They may have disabilities How does a colorblind person sees my application Will my application cause a seizure to an epileptic person There are even user that prefer to use the keyboard over the mouse Remember all these vi / emacs users
  • 19. What does dojo supports Browsers User’s locale can be determined by the application’s user, and defaults to the locale defined upon browser installation Localization Based on the user’s locale Parsing Presentation Number, currency, date, time Internationalization Dojo fetches the right string and messages (a.k.a resource bundle) based on the user’s locale Accessibility Keyboard navigation High contrast mode WAI roles and states
  • 20. What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application  has data, algorithms, APIs Accessed  the application itself can be accessed by anyone Web browser  Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network  there is a need to minimize what’s being communicated
  • 21.  
  • 22. The skill set of client side development is very different from the skill set of server side development Technologies Html, css, JavaScript, dom, flash/flex Platforms Browsers, devices Soft skills Usability, visual design Performance Network, runtime Other considerations Internationalization, accessibility Technologies Java/ C# , PHP Platforms Servers, OS Soft skills Multi threading, deployment configuration Performance Connections, compilation optimizations Other considerations Security, portability Each of these skills carries a baggage: tools, methodologies, protocols, testing etc.
  • 23. Templating Templating is automatic generation of code The generator accepts Data Generation template – a description how to transform data to code Need to have a good understanding of the generated code in order to create a good template Client side code generation is usually done on the server side, mixed with server side code Think of servlets / JSP / ASP / PHP
  • 24. Dojox.dtl – client side template engine A client side template engine Client side code generation as part of client side code What do we get by moving the engine to the client side Server side developer develop server side code Client side developer develop client side code Only the data is sent over the network Based on the Django Templating Language
  • 25. Dojox.dtl – client side template engine The generation engine uses: The input data is the widget’s object Generation template is the widget’s template The generation engine creates an html code Transformed to DOM object DOM optimizations handled by the engine creators Results eventually in the way that the widget is presented by the browser
  • 26. Dojox.dtl – What can you write there Loops Conditional execution (if-else) Variables Predefined (e.g., a loop’s counter) User defined Knows how to work with dojo’s constructs AttachPoints, AttachEvents, Nested widgets
  • 27. <ul> {% for item in itemsData %} <li class=&quot;collection-row- {{ forloop.counter|divisibleby:&quot;2&quot; }} &quot; dojoAttachEvent=&quot;onmouseover:onMouseOver,onmouseout:onMouseOut&quot; itemIndex=&quot; {{ forloop.counter }} &quot;> <span> <a href=&quot;javascript:void(0)&quot;> {{ item.name }} </a> </span> <span><img src=&quot;/images/ {{ item.state }} -icon.gif&quot;></span> </li> {% endfor %} </ul>
  • 28. Dojox.dtl – when to use A widget that suppose to present model backed information that is determined on runtime Especially when the data is structured and repeating Combine with data stores to get great result with very little code
  • 29. What is a web application From wikipedia: “ An application that is accessed via a web browser over a network” Application  has data, algorithms, APIs Accessed  the application itself can be accessed by anyone Web browser  Ajax technologies in the client side (HTML, DOM, JavaScript, CSS) Over a network  there is a need to minimize what’s being communicated
  • 30. Web application communication scheme (for Ajax application) Client (Browser) Server Cacheable, heavy weighted, Once Non-cacheable, light weighted, Many times Bring me the application Application (.html, .js, .css, icons) Bring me some data Data (xml / json) Take some data Ack
  • 31. How to handle the heavy weight stuff Make it less heavy (shrink it) Thus have a faster loading time Decrease the number of resources that travel over the network Each request comes along with a performance hit payload Less required resources  less requests  less time Cache as much as possible  only the first access to the application is slow
  • 32. Dojo build system Minification of files using Shirnksafe Reduces whitespaces Removes comments Shortens variable names Merging of files to make a layer, which is a merge of several files needed to provide a closed functionality Based on the dojo.require call, build a dependency list and merge all of the files in that list Inline template of widgets into the .js file
  • 33. How to handle the light weighted stuff Make it even lighter Reduce the processing done in the browser for each such interaction Use Json Pros: very efficient and smaller in size (when compared to XML) Cons: Can’t be protocolized (as oppose to XML schema) Agreed upon structure Verifiable contents
  • 34. Dojo to the rescue – dojox.json.schema A schema based on a definition found in json-schema.org Which was already implemented in JavaScript, Java, PHP, Python, Prel, Ruby, .Net etc. Defines a way to protocolize Json objects Dojox.json.schema.Validate Accepts a schema as an argument Accepts a Json object as an argument Performs validation
  • 35. References http://www.dojotoolkit.org http://dojocampus.org http://www.slideshare.net/klipstein/dojodata-stores-and-widgets http://groups.google.com/group/json-schema/web/json-schema-implementations?pli =1