SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Single-Page Applications
2

Introduction
• Petri Niemi, Tieturi Oy
• Web stuff
• Java stuff
• Also a bit of mobile, C# and C++ stuff

• Are you already familiar with single-page applications
(SPA)?
• Related Tieturi courses (for developers):
• Pre-requisite: "Advanced JavaScript Programming"
• Under construction: "Single-Page Applications Workshop"

Copyright © Tieturi Oy
3

Single-Page Application
Wikipedia:
"A single-page application (SPA), also known as single-page
interface (SPI), 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."

Copyright © Tieturi Oy
4

Multi-Page vs. Single-Page 1/2
• Examples of traditional multi-page web sites
• tieturi.fi
• iltalehti.fi
• amazon.com

• Examples of single-page web applications
• Gmail
• Hotmail

• Twitter used to be an SPA, but they went multi-page due to performance reasons
• https://blog.twitter.com/2012/improving-performance-on-twittercom

Copyright © Tieturi Oy
5

Multi-Page vs. Single-Page 2/2
• Main difference is in the way content is loaded and
rendered
• Example: user navigating from index.html to e.g. the
news section of the page/app
• Multi-page: index.html  news.html
• Full reload incl. HTML, CSS, JavaScript, images, …
• Note that the page changes to news.html, constructed by the server

• Single-page: index.html  index.html/#news
• Only load the content that changes (using e.g. AJAX/JSON)
• Use JavaScript to modify the current page's content accordingly
• Page always remains index.html, constructed by the client
Copyright © Tieturi Oy
6

Hashbang (#) URLs
• A way to keep track of navigation history without causing
a full page reload
• Example: navigating from index.html to
index.html/#news
• Does not cause a round-trip to the server
• The portion of the URL after # is never sent to the server

• You can react to the hash change in JavaScript
• E.g. fetch new data and update (part of) the page yourself
• What if the user has JavaScript disabled in the browser?

Copyright © Tieturi Oy
7

Cross-Platform HTML 5 SPAs
• SPAs enable cross-platform mobile applications – in
theory, at least…
• Still lack some capabilities compared to native
applications
• PhoneGap is a popular solution to this
• However, "Vast majority of PhoneGap developers use it solely for
cross-platform publishing purposes, they do not need the device
API access it provides"

• Performance is still also worse than in native apps

Copyright © Tieturi Oy
8

Pros of SPAs
• Improved user experience (UX)
• Similar to native applications
• Animations, user interaction
• Faster navigation from one page to another

• Less data to transfer after initial page load
• The initial load might actually be slower (the Twitter problem)
• Very important especially on mobile

• Thick clients take part of the work load from the server
• It's distributed computing again!
• Servers can become dumber, all they need to do is to provide the
data (AJAX, HTTPRest, JSON)
• Light-weight server technologies on the rise: node.js, for example
Copyright © Tieturi Oy
9

Cons of SPAs
• Thicker clients require (much) more JavaScript
• JavaScript is DIFFICULT (testing, productivity, …)!
• How to pick the right helper libraries (gazillion options available)?
• You must implement low-level stuff yourself on the client
• E.g. page navigation (the back button)

• SPAs are not automatically search-engine friendly
• Due to hashbang URLs and JavaScript generating page content
• https://developers.google.com/webmasters/ajax-crawling/
• Analytics is also an issue

• Server does not know what kind of errors happen on the
client-side
• The server is dumb, remember?
Copyright © Tieturi Oy
10

HTML5 History API
• Will be a cleaner solution to the hashbang URLs we see
today
• Allows you to manipulate the URL and navigation history stack
without causing a page reload
• The URL will be a "proper" URL without hashbangs

• Allows a web app to be treated as a traditional web page and a
single page app at the same time

• Browser support not quite there yet
• Implementations are incoherent!
• IE 9 and older + some older mobile browsers have no support at
all
• http://caniuse.com/#feat=history

• https://github.com/browserstate/history.js/wiki/The-State-of-the-HTML5-History-API

Copyright © Tieturi Oy
11

Conclusions
• Single-page applications are not a one-size-fits-all-solution
• Think about the pros and cons – which matter more in your case?

• When done right, SPAs provide a much better user
experience
•
•
•
•

Especially on mobile clients
You will need to know your JavaScript(!)
You might need to limit your supported browsers list
You might need to figure out how to speed up the initial page load

Copyright © Tieturi Oy
12

Thank You!
Any Questions?

http://www.tieturi.fi/web

Helsinki, Tampere, Tukholma, Göteborg

Copyright © Tieturi Oy

Más contenido relacionado

La actualidad más candente

Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
Ynon Perek
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.Web
Chris Canal
 

La actualidad más candente (20)

Going with the Flow: Rationalizing the workflow options in SharePoint Online
Going with the Flow: Rationalizing the workflow options in SharePoint OnlineGoing with the Flow: Rationalizing the workflow options in SharePoint Online
Going with the Flow: Rationalizing the workflow options in SharePoint Online
 
SharePoint Apps model overview
SharePoint Apps model overviewSharePoint Apps model overview
SharePoint Apps model overview
 
Html5 with SharePoint 2010
Html5 with SharePoint 2010Html5 with SharePoint 2010
Html5 with SharePoint 2010
 
Building mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and BackboneBuilding mobile apps with PhoneGap and Backbone
Building mobile apps with PhoneGap and Backbone
 
Sencha and Spring (Spring 2GX 2013)
Sencha and Spring (Spring 2GX 2013) Sencha and Spring (Spring 2GX 2013)
Sencha and Spring (Spring 2GX 2013)
 
Introduction to SharePoint as a Development Platform
Introduction to SharePoint as a Development PlatformIntroduction to SharePoint as a Development Platform
Introduction to SharePoint as a Development Platform
 
My First SharePoint Online PowerApp
My First SharePoint Online PowerAppMy First SharePoint Online PowerApp
My First SharePoint Online PowerApp
 
Pwa february 2018
Pwa february 2018Pwa february 2018
Pwa february 2018
 
HTML5のご紹介
HTML5のご紹介HTML5のご紹介
HTML5のご紹介
 
How to Successfully Implement Headless Drupal
How to Successfully Implement Headless DrupalHow to Successfully Implement Headless Drupal
How to Successfully Implement Headless Drupal
 
Mobile Devices
Mobile DevicesMobile Devices
Mobile Devices
 
Iconus 2016
Iconus 2016Iconus 2016
Iconus 2016
 
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
Connect 2014 - EXTJS in XPages: Modernizing IBM Notes Views Without Sacrifici...
 
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
2012 - HTML5, CSS3 and jQuery with SharePoint 20102012 - HTML5, CSS3 and jQuery with SharePoint 2010
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
 
Bringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointBringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePoint
 
Single Page Apps
Single Page AppsSingle Page Apps
Single Page Apps
 
Who Needs A Developer For Automated SharePoint Provisioning
Who Needs A Developer For Automated SharePoint ProvisioningWho Needs A Developer For Automated SharePoint Provisioning
Who Needs A Developer For Automated SharePoint Provisioning
 
Angular.js in XPages
Angular.js in XPagesAngular.js in XPages
Angular.js in XPages
 
I knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile appsI knew there had to be a better way to build mobile apps
I knew there had to be a better way to build mobile apps
 
Single Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.WebSingle Page Application Development with backbone.js and Simple.Web
Single Page Application Development with backbone.js and Simple.Web
 

Destacado

An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)
frontendne
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 

Destacado (16)

Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
The rise of single-page applications
The rise of single-page applicationsThe rise of single-page applications
The rise of single-page applications
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)An introduction in to the world of front end automation - frontend ne (02 07-15)
An introduction in to the world of front end automation - frontend ne (02 07-15)
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Js Automation. npm scripts & Gulp
Js Automation. npm scripts & GulpJs Automation. npm scripts & Gulp
Js Automation. npm scripts & Gulp
 
Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster Making Single Page Applications (SPA) faster
Making Single Page Applications (SPA) faster
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page Applications
 
Single page applications
Single page applicationsSingle page applications
Single page applications
 
Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2Front-end development introduction (JavaScript). Part 2
Front-end development introduction (JavaScript). Part 2
 
Single page application
Single page applicationSingle page application
Single page application
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Measuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsMeasuring the Performance of Single Page Applications
Measuring the Performance of Single Page Applications
 
Building single page applications
Building single page applicationsBuilding single page applications
Building single page applications
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 

Similar a 27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Single-Page Applications

Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
Nuxeo
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
Louis-Philippe Lavoie
 

Similar a 27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Single-Page Applications (20)

Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
DIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development todayDIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development today
 
The API and APP-ification of the Web
The API and APP-ification of the WebThe API and APP-ification of the Web
The API and APP-ification of the Web
 
Prototyping like it is 2022
Prototyping like it is 2022 Prototyping like it is 2022
Prototyping like it is 2022
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 
Joomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiencesJoomla as a mobile App backend - ideas, examples and experiences
Joomla as a mobile App backend - ideas, examples and experiences
 
SharePoint Apps 101
SharePoint Apps 101SharePoint Apps 101
SharePoint Apps 101
 
To SPA or not to SPA
To SPA or not to SPATo SPA or not to SPA
To SPA or not to SPA
 
ITT Flisol 2013
ITT Flisol 2013ITT Flisol 2013
ITT Flisol 2013
 
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Modernize Solutions with SharePoint & the Power Platform
Modernize Solutions with SharePoint & the Power PlatformModernize Solutions with SharePoint & the Power Platform
Modernize Solutions with SharePoint & the Power Platform
 
Mobile gotcha
Mobile gotchaMobile gotcha
Mobile gotcha
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
 
2014 Picking a Platform by Anand Kulkarni
2014 Picking a Platform by Anand Kulkarni2014 Picking a Platform by Anand Kulkarni
2014 Picking a Platform by Anand Kulkarni
 
Developing and deploying a website with html5
Developing and deploying a website with html5Developing and deploying a website with html5
Developing and deploying a website with html5
 
Developing an Accessible Web
Developing an Accessible WebDeveloping an Accessible Web
Developing an Accessible Web
 

Más de Tieturi Oy

Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
Tieturi Oy
 
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
Tieturi Oy
 

Más de Tieturi Oy (20)

Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Onlineallekirjoitus, Antti ...
Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Onlineallekirjoitus, Antti ...Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Onlineallekirjoitus, Antti ...
Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Onlineallekirjoitus, Antti ...
 
Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Robotit tulevat Cristina An...
Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Robotit tulevat Cristina An...Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Robotit tulevat Cristina An...
Tieturin aamiaisseminaari: Paluu tulevaisuuteen - Robotit tulevat Cristina An...
 
Tieturi - Paluu tulevaisuuteen, Veli-Matti Heiskanen, 25.5.2016
Tieturi -  Paluu tulevaisuuteen, Veli-Matti Heiskanen,  25.5.2016Tieturi -  Paluu tulevaisuuteen, Veli-Matti Heiskanen,  25.5.2016
Tieturi - Paluu tulevaisuuteen, Veli-Matti Heiskanen, 25.5.2016
 
Kaisa Hernberg: Asiantuntija epämukavuusalueella myyntityössä
Kaisa Hernberg: Asiantuntija epämukavuusalueella myyntityössäKaisa Hernberg: Asiantuntija epämukavuusalueella myyntityössä
Kaisa Hernberg: Asiantuntija epämukavuusalueella myyntityössä
 
Aamiaisseminaari 3.6.: SWOT-ryhmätöiden purku
Aamiaisseminaari 3.6.: SWOT-ryhmätöiden purkuAamiaisseminaari 3.6.: SWOT-ryhmätöiden purku
Aamiaisseminaari 3.6.: SWOT-ryhmätöiden purku
 
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteita. Teemu Anttila...
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteita. Teemu Anttila...Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteita. Teemu Anttila...
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteita. Teemu Anttila...
 
Aamiaisseminaari 3.6.: Johdetut projektit julkisessa hallinnossa . Timo Summa...
Aamiaisseminaari 3.6.: Johdetut projektit julkisessa hallinnossa. Timo Summa...Aamiaisseminaari 3.6.: Johdetut projektit julkisessa hallinnossa. Timo Summa...
Aamiaisseminaari 3.6.: Johdetut projektit julkisessa hallinnossa . Timo Summa...
 
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
 
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
Aamiaisseminaari 3.6.: Kokonaisarkkitehtuuriprojektien haasteet. Tarja Raussi...
 
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteet ja mahdollisuud...
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteet ja mahdollisuud...Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteet ja mahdollisuud...
Aamiaisseminaari 3.6.: Julkisen hallinnon projektien haasteet ja mahdollisuud...
 
Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'Testaus 2014: Paul Gerrard - The Changing Role of Testers'
Testaus 2014: Paul Gerrard - The Changing Role of Testers'
 
Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
Testaus 2014 -seminaari. Minna Aalto, Knowit, Vuoden Testaaja 2013
 
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
Testaus 2014 -seminaari. Kaisa Tirkkonen, Kela. Case Kela: Monimutkaisten ja ...
 
Testaus 2014 -seminaari. Pauli Kauppila, Secrays Oy. Mitä jokaisen testaajan ...
Testaus 2014 -seminaari. Pauli Kauppila, Secrays Oy. Mitä jokaisen testaajan ...Testaus 2014 -seminaari. Pauli Kauppila, Secrays Oy. Mitä jokaisen testaajan ...
Testaus 2014 -seminaari. Pauli Kauppila, Secrays Oy. Mitä jokaisen testaajan ...
 
Testaus 2014 -seminaari. Kari Kakkonen, FiSTB-puheenvuoro.
Testaus 2014 -seminaari. Kari Kakkonen, FiSTB-puheenvuoro.Testaus 2014 -seminaari. Kari Kakkonen, FiSTB-puheenvuoro.
Testaus 2014 -seminaari. Kari Kakkonen, FiSTB-puheenvuoro.
 
Testaus 2014 -seminaari: Arto Kiiskinen, Mirasys Oy. Case Mirasys: Toiminnoil...
Testaus 2014 -seminaari: Arto Kiiskinen, Mirasys Oy. Case Mirasys: Toiminnoil...Testaus 2014 -seminaari: Arto Kiiskinen, Mirasys Oy. Case Mirasys: Toiminnoil...
Testaus 2014 -seminaari: Arto Kiiskinen, Mirasys Oy. Case Mirasys: Toiminnoil...
 
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
Testaus 2014 -seminaari: Paul Gerrard. The Changing Role of Testers’.
 
ICT-palveluprosessit ja toiminnan tehostaminen: Jukka Timonen, "Matkalla koht...
ICT-palveluprosessit ja toiminnan tehostaminen: Jukka Timonen, "Matkalla koht...ICT-palveluprosessit ja toiminnan tehostaminen: Jukka Timonen, "Matkalla koht...
ICT-palveluprosessit ja toiminnan tehostaminen: Jukka Timonen, "Matkalla koht...
 
ICT-palveluprosessit ja toiminnan tehostaminen: Tuukka Heinonen, "Asiakaskoke...
ICT-palveluprosessit ja toiminnan tehostaminen: Tuukka Heinonen, "Asiakaskoke...ICT-palveluprosessit ja toiminnan tehostaminen: Tuukka Heinonen, "Asiakaskoke...
ICT-palveluprosessit ja toiminnan tehostaminen: Tuukka Heinonen, "Asiakaskoke...
 
ICT-palveluprosessit ja toiminnan tehostaminen: Ben Kalland, "Prosessien selk...
ICT-palveluprosessit ja toiminnan tehostaminen: Ben Kalland, "Prosessien selk...ICT-palveluprosessit ja toiminnan tehostaminen: Ben Kalland, "Prosessien selk...
ICT-palveluprosessit ja toiminnan tehostaminen: Ben Kalland, "Prosessien selk...
 

Último

Último (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 

27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Single-Page Applications

  • 2. 2 Introduction • Petri Niemi, Tieturi Oy • Web stuff • Java stuff • Also a bit of mobile, C# and C++ stuff • Are you already familiar with single-page applications (SPA)? • Related Tieturi courses (for developers): • Pre-requisite: "Advanced JavaScript Programming" • Under construction: "Single-Page Applications Workshop" Copyright © Tieturi Oy
  • 3. 3 Single-Page Application Wikipedia: "A single-page application (SPA), also known as single-page interface (SPI), 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." Copyright © Tieturi Oy
  • 4. 4 Multi-Page vs. Single-Page 1/2 • Examples of traditional multi-page web sites • tieturi.fi • iltalehti.fi • amazon.com • Examples of single-page web applications • Gmail • Hotmail • Twitter used to be an SPA, but they went multi-page due to performance reasons • https://blog.twitter.com/2012/improving-performance-on-twittercom Copyright © Tieturi Oy
  • 5. 5 Multi-Page vs. Single-Page 2/2 • Main difference is in the way content is loaded and rendered • Example: user navigating from index.html to e.g. the news section of the page/app • Multi-page: index.html  news.html • Full reload incl. HTML, CSS, JavaScript, images, … • Note that the page changes to news.html, constructed by the server • Single-page: index.html  index.html/#news • Only load the content that changes (using e.g. AJAX/JSON) • Use JavaScript to modify the current page's content accordingly • Page always remains index.html, constructed by the client Copyright © Tieturi Oy
  • 6. 6 Hashbang (#) URLs • A way to keep track of navigation history without causing a full page reload • Example: navigating from index.html to index.html/#news • Does not cause a round-trip to the server • The portion of the URL after # is never sent to the server • You can react to the hash change in JavaScript • E.g. fetch new data and update (part of) the page yourself • What if the user has JavaScript disabled in the browser? Copyright © Tieturi Oy
  • 7. 7 Cross-Platform HTML 5 SPAs • SPAs enable cross-platform mobile applications – in theory, at least… • Still lack some capabilities compared to native applications • PhoneGap is a popular solution to this • However, "Vast majority of PhoneGap developers use it solely for cross-platform publishing purposes, they do not need the device API access it provides" • Performance is still also worse than in native apps Copyright © Tieturi Oy
  • 8. 8 Pros of SPAs • Improved user experience (UX) • Similar to native applications • Animations, user interaction • Faster navigation from one page to another • Less data to transfer after initial page load • The initial load might actually be slower (the Twitter problem) • Very important especially on mobile • Thick clients take part of the work load from the server • It's distributed computing again! • Servers can become dumber, all they need to do is to provide the data (AJAX, HTTPRest, JSON) • Light-weight server technologies on the rise: node.js, for example Copyright © Tieturi Oy
  • 9. 9 Cons of SPAs • Thicker clients require (much) more JavaScript • JavaScript is DIFFICULT (testing, productivity, …)! • How to pick the right helper libraries (gazillion options available)? • You must implement low-level stuff yourself on the client • E.g. page navigation (the back button) • SPAs are not automatically search-engine friendly • Due to hashbang URLs and JavaScript generating page content • https://developers.google.com/webmasters/ajax-crawling/ • Analytics is also an issue • Server does not know what kind of errors happen on the client-side • The server is dumb, remember? Copyright © Tieturi Oy
  • 10. 10 HTML5 History API • Will be a cleaner solution to the hashbang URLs we see today • Allows you to manipulate the URL and navigation history stack without causing a page reload • The URL will be a "proper" URL without hashbangs • Allows a web app to be treated as a traditional web page and a single page app at the same time • Browser support not quite there yet • Implementations are incoherent! • IE 9 and older + some older mobile browsers have no support at all • http://caniuse.com/#feat=history • https://github.com/browserstate/history.js/wiki/The-State-of-the-HTML5-History-API Copyright © Tieturi Oy
  • 11. 11 Conclusions • Single-page applications are not a one-size-fits-all-solution • Think about the pros and cons – which matter more in your case? • When done right, SPAs provide a much better user experience • • • • Especially on mobile clients You will need to know your JavaScript(!) You might need to limit your supported browsers list You might need to figure out how to speed up the initial page load Copyright © Tieturi Oy
  • 12. 12 Thank You! Any Questions? http://www.tieturi.fi/web Helsinki, Tampere, Tukholma, Göteborg Copyright © Tieturi Oy