SlideShare a Scribd company logo
1 of 39
Single Page Applications (SPA)
Jeremy Likness
Principal Architect
@JeremyLikness
Our Mission, Vision, and Values
Our Solutions
INDUSTRIES WE WORK WITH
OUR AWARDS
TODAY’S AGENDA
1. Why? Drivers behind adoption of SPA applications
2. What? Features that Make up a Single Page App
3. How? Frameworks make building apps easier
4. Q&A You have questions, we have answers
WHY?
Why? A Brief History (Pt. 1)
1995
• Complete pages are loaded from the server
• Pages disappear, then reappear
1996
• Internet Explorer introduces the IFRAME
• Dozens of websites adopt this ugly hack
1998
• Microsoft Outlook Web App introduces the XMLHTTP component
1999
• XMLHTTP elevated to ActiveX status
• Mozilla, Safari, Operate implement XMLHttpRequest
2004
• Another web-based email app, GMail, pushes the envelope
• The Ajax standard is born. Work on HTML5 begins (yeah, really!)
2006
• W3C standardizes XMLHttpRequest
Why? (A Brief History Pt. 2)
2006
• jQuery normalizes the DOM
• Developers suddenly have a lot more free time
2007
• Silverlight released
• Microsoft successfully distracts developers away from building SPA apps
2009
• First version of AngularJS is released
2010
• Silverlight 5 is released. It is almost immediately killed
• KnockoutJS is released. BackboneJS is released a few months later
2011
• Last call for HTML5 specification
• EmberJS is released
2015
• It’s simple. “We want to access any app, from anywhere, on any device.”
And you’re responsible to make it happen!
DEMO: Before SPA
Disadvantages
UX Reload Real-time
Server
Load
Network
Load
Mobile
The Experience
UX
• Lacks responsiveness (click and wait)
• Page abandonment
• Amazon: 100ms slower = 1% lost revenue
• Google: 500ms slower = 20% decreased traffic
• Lots of manual effort, limited “one-click” experience
• Real-time notifications and updates are difficult
Reloading and Round-Trips
Reload
• Server logic is often convoluted when trying to pull data from
various areas to aggregate in order to render
• Must remember state and re-render state each time (as
opposed to state being preserved in the client)
• Flicker/page freeze is disruptive
Support for Real-time
Real-time
• Only practical method without SPA is to POST on a timer
• Notifications require rebuilding the entire page
Server and Scalability
Server
Load
• Server must aggregate data from multiple places
• Server now has to process everything again or resort to exotic
cache methods to avoid re-processing on refresh
• Server is responsible for the logic of taking data and
transforming it into presentation, so 1000 clients = 1000x CPU-
bound logic on the server
Chattiness on the Network
Network
Load
Vs.
Mobile-Friendliness
Mobile
• Requires lighter payloads
• Needs simplified model
• Less processing (but less rendering is needed)
• Less data when going over metered networks
Challenges
DOM
Standards
Routing Security
Modularity Testing Development
WHAT?
What? Typical SPA Features
Data Binding
Views /
Components
Routing
Dependency
Injection
Data
Services
Testing
Data-Binding Support
Data-
Binding
• Separate presentation logic from actual presentation
• For example: “button click” vs. “my action” that can then be
bound to a button, hyperlink, or other action
• Validation
• Data transformation
• Leads to testability and scale
• “Designer/developer workflow”
Don’t Repeat Yourself!
Views /
Components
• Support for rendering to a part of the page
• Reusable data transformations (i.e. filters, value converters)
• Reusable components (i.e. grids, type-ahead, dialog boxes, etc.)
• HTML5 standards (Web Components)
• Responsive
• Master/detail side-by-side on desktop
• Master/detail separate pages on mobile
It’s Still the Browser!
Routing
• Navigation: I can browse to an area of the application
• Bookmarks: I can save the hyperlink to a useful piece of
information or workflow that I am a part of
• State: I can persist my state between areas of the application
• Journal: I can use the back and forward buttons on my browser
the way I’m used to
Managing Large Code Bases
Dependency
Injection
• Loosely couple JavaScript objects
• Separation of concerns enables parallel development
• Inversion of control enables testability and promotes reusability
• Service location makes it easier to develop components with
dependencies
Would You Rather This …
Data
Services
… Or This?
Data
Services
Given SPA When Test Then OK!
Testing
• Many frameworks come with their own test suites
• Some have specific support for testing and mocking interfaces
• All should expose a straightforward means to test
• Best frameworks don’t require a dependency on a visible
browser
HOW?
http://jquery.com/
• “Normalize the DOM”
• Most popular JavaScript library in use
• One of the longest maintained frameworks
• Many SPA frameworks can layer on top of this
• DEMO: http://todomvc.com/examples/jquery/#/all
• Source: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/jquery/js/app.js
http://www.typescriptlang.org/
• Fooled you, this isn’t a SPA framework
• Works well with many existing SPA frameworks
• Helps “tame” JavaScript
• Very useful for projects with scale (lots of code and/or many developers)
• Page: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/typescript-angular/index.html
• Source: https://github.com/tastejs/todomvc/tree/gh-
pages/examples/typescript-angular/js
http://knockoutjs.com/
• Introduced in early MVC templates by Microsoft
• Declarative bindings
• Automatic refresh of UI
• Relationships and computed models
• Templates
• Page: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/knockoutjs/index.html
• Source: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/knockoutjs/js/app.js
http://backbonejs.org/
• Model-driven
• Idea of “entities” and “collections”
• Views
• Convention-based REST interface
• Page: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/backbone/index.html
• Source: https://github.com/tastejs/todomvc/tree/gh-
pages/examples/backbone/js
http://emberjs.com/
• Focused on productivity
• Handlebar templates
• Common idioms / convention based
• Page: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/emberjs/index.html
• Source: https://github.com/tastejs/todomvc/tree/gh-
pages/examples/emberjs/js
https://angularjs.org/
• Teach HTML New Tricks
• Extensible
• Dependency injection out of the box
• My favorite framework to use, especially on large projects
• Page: https://github.com/tastejs/todomvc/blob/gh-
pages/examples/angularjs/index.html
• Source: https://github.com/tastejs/todomvc/tree/gh-
pages/examples/angularjs/js
http://www.telerik.com/kendo-ui
• Web and Mobile
• HTML5 and JavaScript focused
• Layered on top of jQuery
• Adapters for AngularJS and BackboneJS “out of the box”
• Page: http://kendotodo.apphb.com/Home/Batch
Angular 2.0
• Embraces ECMAScript 6
• Built on TypeScript
• Example: https://github.com/Microsoft/ngconf2015demo
• Page:
https://github.com/Microsoft/ngconf2015demo/blob/master/todo.html
• Source:
https://github.com/Microsoft/ngconf2015demo/blob/master/todo.ts
http://aurelia.io/
• Convention-based
• Built for ECMAScript 6 from the ground up
• Former member of AngularJS 2.0 team
• Examples: http://aurelia.io/get-started.html
DEMO: Todo SPA
Questions?
• Demo Code: https://github.com/JeremyLikness/SPAAppsExplained
• A Different Angle: What is AngularJS?
http://csharperimage.jeremylikness.com/2014/10/a-different-
angle-what-is-angularjs.html
• Let’s Build an AngularJS App!
http://csharperimage.jeremylikness.com/2014/10/lets-build-
angularjs-app.html
• iVision Application Development:
http://ivision.com/our-services/technology-services/application-
development/
Jeremy Likness, Principal Architect @JeremyLikness

More Related Content

What's hot

Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdev
damianofusco
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
eldorina
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
 

What's hot (20)

Sencha and Spring (Spring 2GX 2013)
Sencha and Spring (Spring 2GX 2013) Sencha and Spring (Spring 2GX 2013)
Sencha and Spring (Spring 2GX 2013)
 
Jasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptJasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScript
 
Lightweight webdev
Lightweight webdevLightweight webdev
Lightweight webdev
 
Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.Webservices: connecting Joomla! with other programs.
Webservices: connecting Joomla! with other programs.
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
BP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPagesBP101: A Modernized Workflow w/ Domino/XPages
BP101: A Modernized Workflow w/ Domino/XPages
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
Backbonemeetup
BackbonemeetupBackbonemeetup
Backbonemeetup
 
Aspect oriented programming
Aspect oriented programmingAspect oriented programming
Aspect oriented programming
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
OSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon KaegiOSGi and JavaScript - Simon Kaegi
OSGi and JavaScript - Simon Kaegi
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
 
APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page Objects
 
learn mvc project in 7 day
learn mvc project in 7 daylearn mvc project in 7 day
learn mvc project in 7 day
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
Angular on ASP.NET MVC 6
Angular on ASP.NET MVC 6Angular on ASP.NET MVC 6
Angular on ASP.NET MVC 6
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovDevelop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val Karpov
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 

Viewers also liked

Viewers also liked (7)

Angular from a Different Angle
Angular from a Different AngleAngular from a Different Angle
Angular from a Different Angle
 
Let's Build an Angular App!
Let's Build an Angular App!Let's Build an Angular App!
Let's Build an Angular App!
 
Angle Forward with TypeScript
Angle Forward with TypeScriptAngle Forward with TypeScript
Angle Forward with TypeScript
 
C# Async/Await Explained
C# Async/Await ExplainedC# Async/Await Explained
C# Async/Await Explained
 
Windows 8.1 Sockets
Windows 8.1 SocketsWindows 8.1 Sockets
Windows 8.1 Sockets
 
Back to the ng2 Future
Back to the ng2 FutureBack to the ng2 Future
Back to the ng2 Future
 
Cross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team ServicesCross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team Services
 

Similar to Single Page Applications: Your Browser is the OS!

Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
Sean McCullough
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”
EPAM Systems
 

Similar to Single Page Applications: Your Browser is the OS! (20)

Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014Transitioning Groupon to Node.js - EmpireJS 2014
Transitioning Groupon to Node.js - EmpireJS 2014
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 PotsdamFrom Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
From Zero to Performance Hero in Minutes - Agile Testing Days 2014 Potsdam
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
 
Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15
 
Tech Talk on Cloud Computing
Tech Talk on Cloud ComputingTech Talk on Cloud Computing
Tech Talk on Cloud Computing
 
Mobile gotcha
Mobile gotchaMobile gotcha
Mobile gotcha
 
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
Integrate Applications into IBM Connections Cloud and On Premises (AD 1632)
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”Чурюканов Вячеслав, “Code simple, but not simpler”
Чурюканов Вячеслав, “Code simple, but not simpler”
 

Recently uploaded

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

Recently uploaded (20)

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...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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
 
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
 

Single Page Applications: Your Browser is the OS!

  • 1. Single Page Applications (SPA) Jeremy Likness Principal Architect @JeremyLikness
  • 2. Our Mission, Vision, and Values
  • 6. TODAY’S AGENDA 1. Why? Drivers behind adoption of SPA applications 2. What? Features that Make up a Single Page App 3. How? Frameworks make building apps easier 4. Q&A You have questions, we have answers
  • 8. Why? A Brief History (Pt. 1) 1995 • Complete pages are loaded from the server • Pages disappear, then reappear 1996 • Internet Explorer introduces the IFRAME • Dozens of websites adopt this ugly hack 1998 • Microsoft Outlook Web App introduces the XMLHTTP component 1999 • XMLHTTP elevated to ActiveX status • Mozilla, Safari, Operate implement XMLHttpRequest 2004 • Another web-based email app, GMail, pushes the envelope • The Ajax standard is born. Work on HTML5 begins (yeah, really!) 2006 • W3C standardizes XMLHttpRequest
  • 9. Why? (A Brief History Pt. 2) 2006 • jQuery normalizes the DOM • Developers suddenly have a lot more free time 2007 • Silverlight released • Microsoft successfully distracts developers away from building SPA apps 2009 • First version of AngularJS is released 2010 • Silverlight 5 is released. It is almost immediately killed • KnockoutJS is released. BackboneJS is released a few months later 2011 • Last call for HTML5 specification • EmberJS is released 2015 • It’s simple. “We want to access any app, from anywhere, on any device.” And you’re responsible to make it happen!
  • 12. The Experience UX • Lacks responsiveness (click and wait) • Page abandonment • Amazon: 100ms slower = 1% lost revenue • Google: 500ms slower = 20% decreased traffic • Lots of manual effort, limited “one-click” experience • Real-time notifications and updates are difficult
  • 13. Reloading and Round-Trips Reload • Server logic is often convoluted when trying to pull data from various areas to aggregate in order to render • Must remember state and re-render state each time (as opposed to state being preserved in the client) • Flicker/page freeze is disruptive
  • 14. Support for Real-time Real-time • Only practical method without SPA is to POST on a timer • Notifications require rebuilding the entire page
  • 15. Server and Scalability Server Load • Server must aggregate data from multiple places • Server now has to process everything again or resort to exotic cache methods to avoid re-processing on refresh • Server is responsible for the logic of taking data and transforming it into presentation, so 1000 clients = 1000x CPU- bound logic on the server
  • 16. Chattiness on the Network Network Load Vs.
  • 17. Mobile-Friendliness Mobile • Requires lighter payloads • Needs simplified model • Less processing (but less rendering is needed) • Less data when going over metered networks
  • 19. WHAT?
  • 20. What? Typical SPA Features Data Binding Views / Components Routing Dependency Injection Data Services Testing
  • 21. Data-Binding Support Data- Binding • Separate presentation logic from actual presentation • For example: “button click” vs. “my action” that can then be bound to a button, hyperlink, or other action • Validation • Data transformation • Leads to testability and scale • “Designer/developer workflow”
  • 22. Don’t Repeat Yourself! Views / Components • Support for rendering to a part of the page • Reusable data transformations (i.e. filters, value converters) • Reusable components (i.e. grids, type-ahead, dialog boxes, etc.) • HTML5 standards (Web Components) • Responsive • Master/detail side-by-side on desktop • Master/detail separate pages on mobile
  • 23. It’s Still the Browser! Routing • Navigation: I can browse to an area of the application • Bookmarks: I can save the hyperlink to a useful piece of information or workflow that I am a part of • State: I can persist my state between areas of the application • Journal: I can use the back and forward buttons on my browser the way I’m used to
  • 24. Managing Large Code Bases Dependency Injection • Loosely couple JavaScript objects • Separation of concerns enables parallel development • Inversion of control enables testability and promotes reusability • Service location makes it easier to develop components with dependencies
  • 25. Would You Rather This … Data Services
  • 27. Given SPA When Test Then OK! Testing • Many frameworks come with their own test suites • Some have specific support for testing and mocking interfaces • All should expose a straightforward means to test • Best frameworks don’t require a dependency on a visible browser
  • 28. HOW?
  • 29. http://jquery.com/ • “Normalize the DOM” • Most popular JavaScript library in use • One of the longest maintained frameworks • Many SPA frameworks can layer on top of this • DEMO: http://todomvc.com/examples/jquery/#/all • Source: https://github.com/tastejs/todomvc/blob/gh- pages/examples/jquery/js/app.js
  • 30. http://www.typescriptlang.org/ • Fooled you, this isn’t a SPA framework • Works well with many existing SPA frameworks • Helps “tame” JavaScript • Very useful for projects with scale (lots of code and/or many developers) • Page: https://github.com/tastejs/todomvc/blob/gh- pages/examples/typescript-angular/index.html • Source: https://github.com/tastejs/todomvc/tree/gh- pages/examples/typescript-angular/js
  • 31. http://knockoutjs.com/ • Introduced in early MVC templates by Microsoft • Declarative bindings • Automatic refresh of UI • Relationships and computed models • Templates • Page: https://github.com/tastejs/todomvc/blob/gh- pages/examples/knockoutjs/index.html • Source: https://github.com/tastejs/todomvc/blob/gh- pages/examples/knockoutjs/js/app.js
  • 32. http://backbonejs.org/ • Model-driven • Idea of “entities” and “collections” • Views • Convention-based REST interface • Page: https://github.com/tastejs/todomvc/blob/gh- pages/examples/backbone/index.html • Source: https://github.com/tastejs/todomvc/tree/gh- pages/examples/backbone/js
  • 33. http://emberjs.com/ • Focused on productivity • Handlebar templates • Common idioms / convention based • Page: https://github.com/tastejs/todomvc/blob/gh- pages/examples/emberjs/index.html • Source: https://github.com/tastejs/todomvc/tree/gh- pages/examples/emberjs/js
  • 34. https://angularjs.org/ • Teach HTML New Tricks • Extensible • Dependency injection out of the box • My favorite framework to use, especially on large projects • Page: https://github.com/tastejs/todomvc/blob/gh- pages/examples/angularjs/index.html • Source: https://github.com/tastejs/todomvc/tree/gh- pages/examples/angularjs/js
  • 35. http://www.telerik.com/kendo-ui • Web and Mobile • HTML5 and JavaScript focused • Layered on top of jQuery • Adapters for AngularJS and BackboneJS “out of the box” • Page: http://kendotodo.apphb.com/Home/Batch
  • 36. Angular 2.0 • Embraces ECMAScript 6 • Built on TypeScript • Example: https://github.com/Microsoft/ngconf2015demo • Page: https://github.com/Microsoft/ngconf2015demo/blob/master/todo.html • Source: https://github.com/Microsoft/ngconf2015demo/blob/master/todo.ts
  • 37. http://aurelia.io/ • Convention-based • Built for ECMAScript 6 from the ground up • Former member of AngularJS 2.0 team • Examples: http://aurelia.io/get-started.html
  • 39. Questions? • Demo Code: https://github.com/JeremyLikness/SPAAppsExplained • A Different Angle: What is AngularJS? http://csharperimage.jeremylikness.com/2014/10/a-different- angle-what-is-angularjs.html • Let’s Build an AngularJS App! http://csharperimage.jeremylikness.com/2014/10/lets-build- angularjs-app.html • iVision Application Development: http://ivision.com/our-services/technology-services/application- development/ Jeremy Likness, Principal Architect @JeremyLikness

Editor's Notes

  1. Kohavi and Longobtham 2007 – Amazon.com Linden 2006 – Google.com Rest are google
  2. Kohavi and Longobtham 2007 – Amazon.com Linden 2006 – Google.com Rest are google