SlideShare una empresa de Scribd logo
1 de 8
Single Page Applications (SPA)
Agenda
 What is Single Page Application
 Difference from traditional web application
 Why SPA?
 SPA Frameworks
 Challenges
Definition
• A single-page application (SPA), is a web application or web site that fits on a single web
page with the goal of providing a more fluid user experience akin to a desktop application.
• In a SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single
page load or the appropriate resources are dynamically loaded and added to the page as
necessary, usually in response to user actions.
• The page does not reload at any point in the process, nor does control transfer to another
page.
• Interaction with the single page application often involves dynamic communication with
the web server behind the scenes.
Characteristics
 Chunking – the web page is constructed by loading chunks of HTML fragments and JSON data instead of receiving full
HTML from a web server on every request. (Backbone.js, jQuery, Upshot.js)
 Controllers – mess of JavaScript code that handles tangled DOM and data manipulations, application logic and AJAX calls
is replaced by controllers that separate views and models using MVC or MVVM patterns.
(Backbone.js, Knockout.js, JavascriptMVC)
 Templating – coding of UI and DOM manipulations are replaced by declarative binding of data to HTML templates.
(Knockout.js, Mustache, jQuery Templates, Underscore.js)
 Routing – selection of views and navigation (without page reloads) that preserves page state, elements and data
(Histrory.js, Crossroads.js, Backbone.js, pjax, HTML5 History API)
 Real-time communication – two-way communication of a client application and web server replaces one-way requests
from a browser (HTML 5 Web Sockets, Socket.io, SignalR)
 Local storage – capabilities of storing data on a browser for performance and offline access replace cookies and intensive
data loads from web server (HTML 5 Local storage).
Difference from traditional web application
 Traditional web page
 Request sent to server
 HTML Response from server
 Browser unloads previously loaded DOM
 Browser creates DOM for the response
 Browser renders DOM
 SPA
 Does not reload the page
 Load Resources (Html, CSS, JavaScript) on
initial page load or as required generally in
response to user action
Why to use SPA
 Performance is certainly better with client-side rendering if you do it right, but
this is not the most compelling reason to build a SPA. (Network speeds are
improving, after all.) With SPA we don't need to use extra queries to the
server to download pages.
 No page flickering since no page reload
 Faster UI, more interactive
 Less data transfer between clients and servers
 Caching is lot easier as static data is explicitly separated
 Faster Development
When to use SPA
 Native/Desktop like application experience is desired.
 Highly responsive site is desired. Real time communication
 Supports tons of rich UI components in multiple states on same page very efficiently.
Top Challenges in SPA
 Analytics
 Analytics code that run on every page load fails to work in case of SPA, as there is no page reload
 Browser constraints
 Back button behavior is not easy to maintain, manual coding efforts needs to be made to maintain the
browser state
 Bookmark handling, (every time we open the previously saved bookmark, the expected view needs to
be rendered)
 Security Concerns
 Single Page Apps are a little extra vulnerable to both Cross-Site Scripting (XSS) attacks and Cross-Site
Request Forgery (CSRF) attacks. We have to be little extra cautious while building SPA, to defuse such
attacks though server side apps are also vulnerable.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
 
Single page App
Single page AppSingle page App
Single page App
 
Single page application and Framework
Single page application and FrameworkSingle page application and Framework
Single page application and Framework
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Building WordPress sites with AngularJS and the RESTful plugin JSON APIBuilding WordPress sites with AngularJS and the RESTful plugin JSON API
Building WordPress sites with AngularJS and the RESTful plugin JSON API
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Getting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmetaGetting SEO performance in Angular Meteor with ngmeta
Getting SEO performance in Angular Meteor with ngmeta
 
single page application
single page applicationsingle page application
single page application
 
Web technologies practical guide
Web technologies practical guideWeb technologies practical guide
Web technologies practical guide
 
Using MAMP for Web Development
Using MAMP for Web DevelopmentUsing MAMP for Web Development
Using MAMP for Web Development
 
Using WordPress as a Headless CMS
Using WordPress as a Headless CMSUsing WordPress as a Headless CMS
Using WordPress as a Headless CMS
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Javascript & Jquery
Javascript & JqueryJavascript & Jquery
Javascript & Jquery
 
node.js in action
node.js in actionnode.js in action
node.js in action
 
Jquery
JqueryJquery
Jquery
 
Basic web page designing
Basic web page designingBasic web page designing
Basic web page designing
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3
 
Basic web designing 2
Basic web designing 2Basic web designing 2
Basic web designing 2
 
A Gentle Introduction to Blazor
A Gentle Introduction to BlazorA Gentle Introduction to Blazor
A Gentle Introduction to Blazor
 
Building JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJSBuilding JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJS
 

Destacado

Producto comunicativo foro i e learning
Producto comunicativo  foro i e learningProducto comunicativo  foro i e learning
Producto comunicativo foro i e learning
paucermo
 

Destacado (14)

Cloud & PHP
Cloud & PHPCloud & PHP
Cloud & PHP
 
NJ Future Forum 2012 Net-Plus LeJava
NJ Future Forum 2012 Net-Plus LeJavaNJ Future Forum 2012 Net-Plus LeJava
NJ Future Forum 2012 Net-Plus LeJava
 
CV nrupen
CV nrupenCV nrupen
CV nrupen
 
São valentim
São valentimSão valentim
São valentim
 
Evaluacion
EvaluacionEvaluacion
Evaluacion
 
International Trade hs
International Trade hsInternational Trade hs
International Trade hs
 
Scoping Study of Land Tenure and Land Governance Issues in Latin A...
Scoping  Study  of  Land  Tenure  and  Land  Governance  Issues  in  Latin  A...Scoping  Study  of  Land  Tenure  and  Land  Governance  Issues  in  Latin  A...
Scoping Study of Land Tenure and Land Governance Issues in Latin A...
 
Producto comunicativo foro i e learning
Producto comunicativo  foro i e learningProducto comunicativo  foro i e learning
Producto comunicativo foro i e learning
 
Leed nd and local governments 031213_Includes Aurora and Arvada
Leed nd and local governments 031213_Includes Aurora and ArvadaLeed nd and local governments 031213_Includes Aurora and Arvada
Leed nd and local governments 031213_Includes Aurora and Arvada
 
Storytelling in Transylvania: Make Your Voice Heard
Storytelling in Transylvania: Make Your Voice HeardStorytelling in Transylvania: Make Your Voice Heard
Storytelling in Transylvania: Make Your Voice Heard
 
La Globalización -Pablo Pazmay-
La Globalización   -Pablo Pazmay-La Globalización   -Pablo Pazmay-
La Globalización -Pablo Pazmay-
 
Γ1 Πρόσκληση σε αποκριάτικο πάρτυ
Γ1 Πρόσκληση σε αποκριάτικο πάρτυΓ1 Πρόσκληση σε αποκριάτικο πάρτυ
Γ1 Πρόσκληση σε αποκριάτικο πάρτυ
 
PROPAGANDA REIGIOSA
PROPAGANDA REIGIOSAPROPAGANDA REIGIOSA
PROPAGANDA REIGIOSA
 
Pasqua unitat didàctica
Pasqua unitat didàcticaPasqua unitat didàctica
Pasqua unitat didàctica
 

Similar a Single page applications

My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
Ghaffar Khan
 
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
 

Similar a Single page applications (20)

Single Page Application (SPA): A Comprehensive Guide for Beginners
Single Page Application (SPA): A Comprehensive Guide for BeginnersSingle Page Application (SPA): A Comprehensive Guide for Beginners
Single Page Application (SPA): A Comprehensive Guide for Beginners
 
Lessons from the Trenches: Engineering Great AJAX Experiences
Lessons from the Trenches: Engineering Great AJAX ExperiencesLessons from the Trenches: Engineering Great AJAX Experiences
Lessons from the Trenches: Engineering Great AJAX Experiences
 
Lessons
LessonsLessons
Lessons
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Components of a Generic Web Application Architecture
Components of  a Generic Web Application ArchitectureComponents of  a Generic Web Application Architecture
Components of a Generic Web Application Architecture
 
Web Usability
Web UsabilityWeb Usability
Web Usability
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
My Presentation On Ajax
My Presentation On AjaxMy Presentation On Ajax
My Presentation On Ajax
 
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
 
Overview of AJAX
Overview of AJAXOverview of AJAX
Overview of AJAX
 
Performance anti patterns in ajax applications
Performance anti patterns in ajax applicationsPerformance anti patterns in ajax applications
Performance anti patterns in ajax applications
 
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax ApplicationsTSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
 
AJAX
AJAXAJAX
AJAX
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
Web assembly with PWA
Web assembly with PWA Web assembly with PWA
Web assembly with PWA
 
Advantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client applicationAdvantages and disadvantages of an ajax based client application
Advantages and disadvantages of an ajax based client application
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Ajax & Reverse Ajax Presenation
Ajax & Reverse Ajax PresenationAjax & Reverse Ajax Presenation
Ajax & Reverse Ajax Presenation
 
Client-side Rendering Vs. Server-side Rendering Vs. Pre-Rendering for Web App...
Client-side Rendering Vs. Server-side Rendering Vs. Pre-Rendering for Web App...Client-side Rendering Vs. Server-side Rendering Vs. Pre-Rendering for Web App...
Client-side Rendering Vs. Server-side Rendering Vs. Pre-Rendering for Web App...
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+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@
 
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
 

Último (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+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...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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...
 
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
 
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
 
"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 ...
 
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
 
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
 
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
 
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
 

Single page applications

  • 2. Agenda  What is Single Page Application  Difference from traditional web application  Why SPA?  SPA Frameworks  Challenges
  • 3. Definition • A single-page application (SPA), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application. • In a SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load or the appropriate resources are dynamically loaded and added to the page as necessary, usually in response to user actions. • The page does not reload at any point in the process, nor does control transfer to another page. • Interaction with the single page application often involves dynamic communication with the web server behind the scenes.
  • 4. Characteristics  Chunking – the web page is constructed by loading chunks of HTML fragments and JSON data instead of receiving full HTML from a web server on every request. (Backbone.js, jQuery, Upshot.js)  Controllers – mess of JavaScript code that handles tangled DOM and data manipulations, application logic and AJAX calls is replaced by controllers that separate views and models using MVC or MVVM patterns. (Backbone.js, Knockout.js, JavascriptMVC)  Templating – coding of UI and DOM manipulations are replaced by declarative binding of data to HTML templates. (Knockout.js, Mustache, jQuery Templates, Underscore.js)  Routing – selection of views and navigation (without page reloads) that preserves page state, elements and data (Histrory.js, Crossroads.js, Backbone.js, pjax, HTML5 History API)  Real-time communication – two-way communication of a client application and web server replaces one-way requests from a browser (HTML 5 Web Sockets, Socket.io, SignalR)  Local storage – capabilities of storing data on a browser for performance and offline access replace cookies and intensive data loads from web server (HTML 5 Local storage).
  • 5. Difference from traditional web application  Traditional web page  Request sent to server  HTML Response from server  Browser unloads previously loaded DOM  Browser creates DOM for the response  Browser renders DOM  SPA  Does not reload the page  Load Resources (Html, CSS, JavaScript) on initial page load or as required generally in response to user action
  • 6. Why to use SPA  Performance is certainly better with client-side rendering if you do it right, but this is not the most compelling reason to build a SPA. (Network speeds are improving, after all.) With SPA we don't need to use extra queries to the server to download pages.  No page flickering since no page reload  Faster UI, more interactive  Less data transfer between clients and servers  Caching is lot easier as static data is explicitly separated  Faster Development
  • 7. When to use SPA  Native/Desktop like application experience is desired.  Highly responsive site is desired. Real time communication  Supports tons of rich UI components in multiple states on same page very efficiently.
  • 8. Top Challenges in SPA  Analytics  Analytics code that run on every page load fails to work in case of SPA, as there is no page reload  Browser constraints  Back button behavior is not easy to maintain, manual coding efforts needs to be made to maintain the browser state  Bookmark handling, (every time we open the previously saved bookmark, the expected view needs to be rendered)  Security Concerns  Single Page Apps are a little extra vulnerable to both Cross-Site Scripting (XSS) attacks and Cross-Site Request Forgery (CSRF) attacks. We have to be little extra cautious while building SPA, to defuse such attacks though server side apps are also vulnerable.

Notas del editor

  1. Desktop feel – no flickering / white pages – no complete reload, Only parts of the application are repainted Faster, More interactive – user feel connected – generally I would go visit some other tab / some other app while a page is loading .. But these apps doesn’t give enough time They keep you busy. Less data transfer : previously <HTML>data<HTML> Caching – a big plus and credit goes to clear saperation of data and templates. Cached by browser During app use most SPA technologies would cache templates in memory Offloading – intelligent solution to buden browser with some processing Faster development – generally SPA framewok is used which lets you quite easily play with the UI. No more worry about updating the DOM with result, all you care is updating the model View upation happens automatically