SlideShare une entreprise Scribd logo
1  sur  27
building large apps


                rebecca murphey • dojoconf • @rmurphey


Saturday, September 17, 11
A content management system for
         constructing content-rich mobile applications.
         A content publishing system that uses Dojo
         and PhoneGap to create a mobile app from the
         output of the CMS.


Saturday, September 17, 11
Saturday, September 17, 11
Data




                                                                                            Page Controller
                                                                                                               Component


             URL Change      Router                   Route                  Page Factory                      Component
                                                                                                  Capability

                                                                                                               Component



               Device
              Storage




               Remote




                                                       UI




                                                     Browser
                             Page Container
                               Old Page Controller           New Page Controller
                                Component                      Component

                                Component                      Component

                                Component                      Component




Saturday, September 17, 11
e secret to building large apps is
           never build large apps. Break up your
           applications into small pieces. en,
           assemble those testable, bite-sized pieces
           into your big application.
                                            Justin Meyer




Saturday, September 17, 11
Data




                                                                                            Page Controller
                                                                                                               Component


             URL Change      Router                   Route                  Page Factory                      Component
                                                                                                  Capability

                                                                                                               Component



               Device
              Storage




               Remote




                                                       UI




                                                     Browser
                             Page Container
                               Old Page Controller           New Page Controller
                                Component                      Component

                                Component                      Component

                                Component                      Component




Saturday, September 17, 11
Data




                    URL Change   Router   Route




                       Device
                      Storage




                       Remote



Saturday, September 17, 11
Page Controller
                                                Component


           Page Factory                         Component
                                   Capability

                                                Component




Saturday, September 17, 11
UI




                                                    Browser
                             Page Container
                              Old Page Controller          New Page Controller
                                Component                     Component

                                Component                     Component

                                Component                     Component




Saturday, September 17, 11
Data




                    URL Change   Router   Route




                       Device
                      Storage




                       Remote



Saturday, September 17, 11
#/node/123




Saturday, September 17, 11
function nodeRoute(route, nodeId, pageState) {
                  pageState = pageState || {};

                     var nodeModel = toura.app.Data.getModel(nodeId),
                         page = toura.app.UI.getCurrentPage();

                     if (!page || !page.node || nodeId !== page.node.id) {
                       page = toura.app.PageFactory.createPage('node', nodeModel);

                       page.init(pageState);
                       toura.app.UI.showPage(page, nodeModel);
                     } else {
                       page.init(pageState);
                     }
                }




Saturday, September 17, 11
Page Controller
                                                Component


           Page Factory                         Component
                                   Capability

                                                Component




Saturday, September 17, 11
function nodeRoute(route, nodeId, pageState) {
                  pageState = pageState || {};

                     var nodeModel = toura.app.Data.getModel(nodeId),
                         page = toura.app.UI.getCurrentPage();

                     if (!page || !page.node || nodeId !== page.node.id) {
                       page = toura.app.PageFactory.createPage('node', nodeModel);

                       page.init(pageState);
                       toura.app.UI.showPage(page, nodeModel);
                     } else {
                       page.init(pageState);
                     }
                }




Saturday, September 17, 11
Saturday, September 17, 11
this.connect(this.videoList, 'onSelect', function(assetId) {
            var video = this._videoById(assetId);
            this.videoCaption.set('content', video.caption || '');
            this.videoPlayer.play(assetId);
          });




Saturday, September 17, 11
videoPlayer.set('mediaId', mediaId);




                             _setMediaIdAttr : function(mediaId) {
                               var media = this.media = this.mediasCache[mediaId];

                                  if (this.useHtml5Player && !this.player) {
                                    this._queuedMedia = media;
                                    return;
                                  }

                                  this._queuedMedia = null;

                                  if (this.player) {
                                    this.player.src = media.url;
                                  }
                             },



Saturday, September 17, 11
myComponent.set(key, val)
          to change state

          myComponent.on<Evt>(data)
          to announce state changes

          myComponent.subscribe(topic)
          to react to published topics

          dojo.publish(topic, data)
          to announce occurrences of app-wide interest

          myController.connect(component, evt, handler)
          to listen for events & methods



Saturday, September 17, 11
Saturday, September 17, 11
Search Input


                                                           toura.app.Data.search(term)
             searchInputInstance.onSearch(term)




                                            Search Page
                                            Controller          Application Data



    searchResults.set('results', resultSet)
                                                           return resultSet



                                          Search Results
                                             Display




Saturday, September 17, 11
dojo.declare(
            'toura.pageControllers.search.Search',
            [ toura.pageControllers._Page ], {

              // ...

              postCreate : function() {
                // ...
                this.connect(this.searchInput, 'onSearch', '_handleSearch');
              },

              _handleSearch : function(term) {
                if (term === this.lastSearchTerm) { return; }
                this.searchResults.set('results', toura.app.Data.search(term));
              },

            // ...
          });




Saturday, September 17, 11
Page Controller
                                                Component


           Page Factory                         Component
                                   Capability

                                                Component




Saturday, September 17, 11
UI




                                                    Browser
                             Page Container
                              Old Page Controller          New Page Controller
                                Component                     Component

                                Component                     Component

                                Component                     Component




Saturday, September 17, 11
function nodeRoute(route, nodeId, pageState) {
                  pageState = pageState || {};

                     var nodeModel = toura.app.Data.getModel(nodeId),
                         page = toura.app.UI.getCurrentPage();

                     if (!page || !page.node || nodeId !== page.node.id) {
                       page = toura.app.PageFactory.createPage('node', nodeModel);

                       page.init(pageState);
                       toura.app.UI.showPage(page, nodeModel);
                     } else {
                       page.init(pageState);
                     }
                }




Saturday, September 17, 11
showPage : function(page, node) {
                        if (page.startup) {
                          var s = dojo.subscribe('/page/transition/end', function() {
                            page.startup();
                            dojo.unsubscribe(s);
                          });
                        }

                             this.containers.pages.set('content', page);
                             this.currentPage = page;
                      }




Saturday, September 17, 11
Saturday, September 17, 11
http://toura.github.com/mulberry
                @touradev




                             rebeccamurphey.com • blog.rebeccamurphey.com • @rmurphey




Saturday, September 17, 11

Contenu connexe

Similaire à DojoConf: Building Large Apps

Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gotham
Rebecca Murphey
 
Introduction to share point 2010 development
Introduction to share point 2010 developmentIntroduction to share point 2010 development
Introduction to share point 2010 development
Eric Shupps
 
Mobile Testing and Mobile Automation at eBay
Mobile Testing and Mobile Automation at eBayMobile Testing and Mobile Automation at eBay
Mobile Testing and Mobile Automation at eBay
Michael Palotas
 
Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBay
Dominik Dary
 
Radu’S Robots
Radu’S RobotsRadu’S Robots
Radu’S Robots
raxorio
 
FatWire Tutorial For Site Studio Developers
FatWire Tutorial For Site Studio DevelopersFatWire Tutorial For Site Studio Developers
FatWire Tutorial For Site Studio Developers
Brian Huff
 

Similaire à DojoConf: Building Large Apps (20)

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
 
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
Deep Dive SharePoint 2013: Developing applications in SharePoint 2013: forget...
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpro
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpro
 
Introduction to share point 2010 development
Introduction to share point 2010 developmentIntroduction to share point 2010 development
Introduction to share point 2010 development
 
Classification of Web Applications
Classification of Web ApplicationsClassification of Web Applications
Classification of Web Applications
 
Sap webdynpro abap training
Sap webdynpro abap trainingSap webdynpro abap training
Sap webdynpro abap training
 
SAP WEBDYNPRO ABAP TRAINING
SAP WEBDYNPRO ABAP TRAININGSAP WEBDYNPRO ABAP TRAINING
SAP WEBDYNPRO ABAP TRAINING
 
앱스프레소를 이용한 모바일 앱 개발(1)
앱스프레소를 이용한 모바일 앱 개발(1)앱스프레소를 이용한 모바일 앱 개발(1)
앱스프레소를 이용한 모바일 앱 개발(1)
 
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
Seamless Integrations between WebCenter Content, Site Studio, and WebCenter S...
 
Mobile Testing and Mobile Automation at eBay
Mobile Testing and Mobile Automation at eBayMobile Testing and Mobile Automation at eBay
Mobile Testing and Mobile Automation at eBay
 
Mobile Test Automation at eBay
Mobile Test Automation at eBayMobile Test Automation at eBay
Mobile Test Automation at eBay
 
SOA/SCA FraScAti
SOA/SCA FraScAtiSOA/SCA FraScAti
SOA/SCA FraScAti
 
Radu’S Robots
Radu’S RobotsRadu’S Robots
Radu’S Robots
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
 
DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013DevOps for Mobile - DevOpsDays, NY, 2013
DevOps for Mobile - DevOpsDays, NY, 2013
 
Optaros Surf Code Camp Introduction
Optaros Surf Code Camp IntroductionOptaros Surf Code Camp Introduction
Optaros Surf Code Camp Introduction
 
FatWire Tutorial For Site Studio Developers
FatWire Tutorial For Site Studio DevelopersFatWire Tutorial For Site Studio Developers
FatWire Tutorial For Site Studio Developers
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 

Plus de Rebecca Murphey

Getting Started with Mulberry
Getting Started with MulberryGetting Started with Mulberry
Getting Started with Mulberry
Rebecca Murphey
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
Rebecca Murphey
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
Rebecca Murphey
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
Rebecca Murphey
 

Plus de Rebecca Murphey (13)

Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsBeyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
 
A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End Devs
 
BVJS
BVJSBVJS
BVJS
 
Getting Started with Mulberry
Getting Started with MulberryGetting Started with Mulberry
Getting Started with Mulberry
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
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
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
 
Using Objects to Organize your jQuery Code
Using Objects to Organize your jQuery CodeUsing Objects to Organize your jQuery Code
Using Objects to Organize your jQuery Code
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 

Dernier

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
 
+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@
 

Dernier (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
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
 
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
 
+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...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

DojoConf: Building Large Apps

  • 1. building large apps rebecca murphey • dojoconf • @rmurphey Saturday, September 17, 11
  • 2. A content management system for constructing content-rich mobile applications. A content publishing system that uses Dojo and PhoneGap to create a mobile app from the output of the CMS. Saturday, September 17, 11
  • 4. Data Page Controller Component URL Change Router Route Page Factory Component Capability Component Device Storage Remote UI Browser Page Container Old Page Controller New Page Controller Component Component Component Component Component Component Saturday, September 17, 11
  • 5. e secret to building large apps is never build large apps. Break up your applications into small pieces. en, assemble those testable, bite-sized pieces into your big application. Justin Meyer Saturday, September 17, 11
  • 6. Data Page Controller Component URL Change Router Route Page Factory Component Capability Component Device Storage Remote UI Browser Page Container Old Page Controller New Page Controller Component Component Component Component Component Component Saturday, September 17, 11
  • 7. Data URL Change Router Route Device Storage Remote Saturday, September 17, 11
  • 8. Page Controller Component Page Factory Component Capability Component Saturday, September 17, 11
  • 9. UI Browser Page Container Old Page Controller New Page Controller Component Component Component Component Component Component Saturday, September 17, 11
  • 10. Data URL Change Router Route Device Storage Remote Saturday, September 17, 11
  • 12. function nodeRoute(route, nodeId, pageState) { pageState = pageState || {}; var nodeModel = toura.app.Data.getModel(nodeId), page = toura.app.UI.getCurrentPage(); if (!page || !page.node || nodeId !== page.node.id) { page = toura.app.PageFactory.createPage('node', nodeModel); page.init(pageState); toura.app.UI.showPage(page, nodeModel); } else { page.init(pageState); } } Saturday, September 17, 11
  • 13. Page Controller Component Page Factory Component Capability Component Saturday, September 17, 11
  • 14. function nodeRoute(route, nodeId, pageState) { pageState = pageState || {}; var nodeModel = toura.app.Data.getModel(nodeId), page = toura.app.UI.getCurrentPage(); if (!page || !page.node || nodeId !== page.node.id) { page = toura.app.PageFactory.createPage('node', nodeModel); page.init(pageState); toura.app.UI.showPage(page, nodeModel); } else { page.init(pageState); } } Saturday, September 17, 11
  • 16. this.connect(this.videoList, 'onSelect', function(assetId) { var video = this._videoById(assetId); this.videoCaption.set('content', video.caption || ''); this.videoPlayer.play(assetId); }); Saturday, September 17, 11
  • 17. videoPlayer.set('mediaId', mediaId); _setMediaIdAttr : function(mediaId) { var media = this.media = this.mediasCache[mediaId]; if (this.useHtml5Player && !this.player) { this._queuedMedia = media; return; } this._queuedMedia = null; if (this.player) { this.player.src = media.url; } }, Saturday, September 17, 11
  • 18. myComponent.set(key, val) to change state myComponent.on<Evt>(data) to announce state changes myComponent.subscribe(topic) to react to published topics dojo.publish(topic, data) to announce occurrences of app-wide interest myController.connect(component, evt, handler) to listen for events & methods Saturday, September 17, 11
  • 20. Search Input toura.app.Data.search(term) searchInputInstance.onSearch(term) Search Page Controller Application Data searchResults.set('results', resultSet) return resultSet Search Results Display Saturday, September 17, 11
  • 21. dojo.declare( 'toura.pageControllers.search.Search', [ toura.pageControllers._Page ], { // ... postCreate : function() { // ... this.connect(this.searchInput, 'onSearch', '_handleSearch'); }, _handleSearch : function(term) { if (term === this.lastSearchTerm) { return; } this.searchResults.set('results', toura.app.Data.search(term)); }, // ... }); Saturday, September 17, 11
  • 22. Page Controller Component Page Factory Component Capability Component Saturday, September 17, 11
  • 23. UI Browser Page Container Old Page Controller New Page Controller Component Component Component Component Component Component Saturday, September 17, 11
  • 24. function nodeRoute(route, nodeId, pageState) { pageState = pageState || {}; var nodeModel = toura.app.Data.getModel(nodeId), page = toura.app.UI.getCurrentPage(); if (!page || !page.node || nodeId !== page.node.id) { page = toura.app.PageFactory.createPage('node', nodeModel); page.init(pageState); toura.app.UI.showPage(page, nodeModel); } else { page.init(pageState); } } Saturday, September 17, 11
  • 25. showPage : function(page, node) { if (page.startup) { var s = dojo.subscribe('/page/transition/end', function() { page.startup(); dojo.unsubscribe(s); }); } this.containers.pages.set('content', page); this.currentPage = page; } Saturday, September 17, 11
  • 27. http://toura.github.com/mulberry @touradev rebeccamurphey.com • blog.rebeccamurphey.com • @rmurphey Saturday, September 17, 11