SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
SELA DEVELOPER PRACTICE
December 15-19, 2013

Gil Fink

Single Page Apps (SPAs)
Agenda
•
•
•

•
•
•

The Road to Single Page Apps
What is a SPA?
SPA Building Blocks and Architecture
AMD and RequireJS
MVC using BackboneJS
A Simple SPA
The Road to Single Page Apps
Native
Apps

ClickOnce

Thin
Clients
and App
Stores

Embedded
Objects (Flash,
Silverlight, Java
Applets …)

Websites

Web
Apps

RIA

SPA
Traditional Web Apps
HTTP requests translated into user actions
The state persisted in the server side
The server translates the user action
The server translates its response to HTML
The browser displays the HTML response
Traditional Native Apps
State is persisted in the client-side
Compiled programming language is used
The application is platform dependent
An installation may be required
What is a Single Page App (SPA)?
A web application
No need for full page submit
No full refresh
No embedded objects
Client-side routing
Why to Develop SPAs?
Feature

Web App

Native App

Single Page App

Cross Platform

V

X

V

Client State
Management

X

V

V

No Installation
required

V

X

V

SPA

Web
App

Native
App
SPA Building Blocks
Web API

SPA

REST
AJAX

JavaScript Libraries
HTML5
HTML5
Supported by most modern browsers
Include variety of new JavaScript APIs that can
help to:
Store data locally
Save data across application shutdowns
Communicate with the server in new ways
Like CORS and Web Sockets

Increase performance
AJAX
Asynchronously call server endpoints
Non blocking operations

You can maintain state on the client and go to
the server without refreshing the whole page
Has opened the road for richer client-side UX
JavaScript Libraries/Frameworks
REST
Stands for REpresntational State Transfer
Architecture style
Designed to work with HTTP
Using HTTP verbs (POST, GET, PUT, DELETE)
Performs Create, Read, Update and Delete operations
respectively
Can also use other HTTP verbs

Can receive and send data in variety of formats
JSON, XML, HTML, XHTML, Blob and more
Web API
The server is used only as API
Each API Function is an endpoint in the server

No need for server rendering
No need for server routing
SPA Architecture
Async Module Definitions (AMD)
Define modules such that the module and its
dependencies can be asynchronously loaded
RequireJS Library
A module framework in the browser
Can be downloaded from
http://requirejs.org/

Browser friendly API
Supports NodeJS as well

Defines a structure for files layout
Uses conventions to perform lookups for dependencies
RequireJS

Demo
MVC using BackboneJS
BackboneJS is a small MV* library
Enforces structure in your JavaScript code
Includes only 5 main objects:
Models
Collections
Views
Routers
Events
MVC using BackboneJS – Cont.
Extending one of BackboneJS main objects
To have built-in BackboneJS functionality
To create your own custom functionality
var myModel = Backbone.Model.extend({
defaults: {
myModelID: 0,
myModelName: ‘’
}
});
Var myCollection = Backbone.Collection.extend({
model: myModel
});
var myRouter = Backbone.Router.extend({
routes: {
‘’: home
},
home: function() {
// create the home view
}
});
A Simple SPA

Demo
Questions
Summary

•

SPAs are web apps built upon one page and
JavaScript interactions
Very suitable for mobile development

•

SPAs are the way to build your next web apps!

•
Thank You

Más contenido relacionado

La actualidad más candente

Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 

La actualidad más candente (20)

Azure Serverless Conf
Azure Serverless ConfAzure Serverless Conf
Azure Serverless Conf
 
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
 
Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server Apps
 
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Scaling Wordpress
Scaling WordpressScaling Wordpress
Scaling Wordpress
 
Single page App
Single page AppSingle page App
Single page App
 
Pros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside AppPros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside App
 
Javascript & Jquery
Javascript & JqueryJavascript & Jquery
Javascript & Jquery
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
 
Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5
 
SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5SoCal Code Camp 2011 - ASP.NET 4.5
SoCal Code Camp 2011 - ASP.NET 4.5
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Introduction to JavaScript Full Stack
Introduction to JavaScript Full StackIntroduction to JavaScript Full Stack
Introduction to JavaScript Full Stack
 
Full stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choiceFull stack JavaScript - the folly of choice
Full stack JavaScript - the folly of choice
 
Jquery
JqueryJquery
Jquery
 
Codegen2021 blazor mobile
Codegen2021 blazor mobileCodegen2021 blazor mobile
Codegen2021 blazor mobile
 
MSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure FunctionsMSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure Functions
 
Web technologies practical guide
Web technologies practical guideWeb technologies practical guide
Web technologies practical guide
 

Destacado (6)

Introduction to jQuery Mobile
Introduction to jQuery MobileIntroduction to jQuery Mobile
Introduction to jQuery Mobile
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
 
Tech Talks - Fundamentos JavaScript
Tech Talks - Fundamentos JavaScriptTech Talks - Fundamentos JavaScript
Tech Talks - Fundamentos JavaScript
 
WEB 2.0: BUILDING RICH INTERNET APPLICATIONS WITH PHP
WEB 2.0: BUILDING RICH INTERNET APPLICATIONS WITH PHPWEB 2.0: BUILDING RICH INTERNET APPLICATIONS WITH PHP
WEB 2.0: BUILDING RICH INTERNET APPLICATIONS WITH PHP
 
Intro to Mobile Web Development with ColdFusion
Intro to Mobile Web Development with ColdFusionIntro to Mobile Web Development with ColdFusion
Intro to Mobile Web Development with ColdFusion
 
Flash, Flex & AIR: A brief survey
Flash, Flex & AIR: A brief surveyFlash, Flex & AIR: A brief survey
Flash, Flex & AIR: A brief survey
 

Similar a Single Page Apps

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
David Xi Peng Yang
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
Adil Mughal
 

Similar a Single Page Apps (20)

Web Development Today
Web Development TodayWeb Development Today
Web Development Today
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)ASP.net MVC Introduction Wikilogia (nov 2014)
ASP.net MVC Introduction Wikilogia (nov 2014)
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
A Microsoft primer for PHP devs
A Microsoft primer for PHP devsA Microsoft primer for PHP devs
A Microsoft primer for PHP devs
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Intro to Azure Static Web Apps
Intro to Azure Static Web AppsIntro to Azure Static Web Apps
Intro to Azure Static Web Apps
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
 
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
MyMobileWeb Certification Part I
MyMobileWeb Certification Part IMyMobileWeb Certification Part I
MyMobileWeb Certification Part I
 
HTML5: the new frontier of the web
HTML5: the new frontier of the webHTML5: the new frontier of the web
HTML5: the new frontier of the web
 

Más de Gil Fink

Más de Gil Fink (20)

Becoming a Tech Speaker
Becoming a Tech SpeakerBecoming a Tech Speaker
Becoming a Tech Speaker
 
Web animation on steroids web animation api
Web animation on steroids web animation api Web animation on steroids web animation api
Web animation on steroids web animation api
 
The Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has ArrivedThe Time for Vanilla Web Components has Arrived
The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Being a tech speaker
Being a tech speakerBeing a tech speaker
Being a tech speaker
 
Working with Data in Service Workers
Working with Data in Service WorkersWorking with Data in Service Workers
Working with Data in Service Workers
 
Demystifying Angular Animations
Demystifying Angular AnimationsDemystifying Angular Animations
Demystifying Angular Animations
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Redux data flow with angular
Redux data flow with angularRedux data flow with angular
Redux data flow with angular
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?
 
One language to rule them all type script
One language to rule them all type scriptOne language to rule them all type script
One language to rule them all type script
 
End to-end apps with type script
End to-end apps with type scriptEnd to-end apps with type script
End to-end apps with type script
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Web components
Web componentsWeb components
Web components
 
Redux data flow with angular 2
Redux data flow with angular 2Redux data flow with angular 2
Redux data flow with angular 2
 
Biological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJSBiological Modeling, Powered by AngularJS
Biological Modeling, Powered by AngularJS
 
Who's afraid of front end databases
Who's afraid of front end databasesWho's afraid of front end databases
Who's afraid of front end databases
 

Último

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
 

Último (20)

"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 ...
 
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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
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, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
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
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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...
 
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...
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
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
 

Single Page Apps

  • 1. SELA DEVELOPER PRACTICE December 15-19, 2013 Gil Fink Single Page Apps (SPAs)
  • 2. Agenda • • • • • • The Road to Single Page Apps What is a SPA? SPA Building Blocks and Architecture AMD and RequireJS MVC using BackboneJS A Simple SPA
  • 3. The Road to Single Page Apps Native Apps ClickOnce Thin Clients and App Stores Embedded Objects (Flash, Silverlight, Java Applets …) Websites Web Apps RIA SPA
  • 4. Traditional Web Apps HTTP requests translated into user actions The state persisted in the server side The server translates the user action The server translates its response to HTML The browser displays the HTML response
  • 5. Traditional Native Apps State is persisted in the client-side Compiled programming language is used The application is platform dependent An installation may be required
  • 6. What is a Single Page App (SPA)? A web application No need for full page submit No full refresh No embedded objects Client-side routing
  • 7. Why to Develop SPAs? Feature Web App Native App Single Page App Cross Platform V X V Client State Management X V V No Installation required V X V SPA Web App Native App
  • 8. SPA Building Blocks Web API SPA REST AJAX JavaScript Libraries HTML5
  • 9. HTML5 Supported by most modern browsers Include variety of new JavaScript APIs that can help to: Store data locally Save data across application shutdowns Communicate with the server in new ways Like CORS and Web Sockets Increase performance
  • 10. AJAX Asynchronously call server endpoints Non blocking operations You can maintain state on the client and go to the server without refreshing the whole page Has opened the road for richer client-side UX
  • 12. REST Stands for REpresntational State Transfer Architecture style Designed to work with HTTP Using HTTP verbs (POST, GET, PUT, DELETE) Performs Create, Read, Update and Delete operations respectively Can also use other HTTP verbs Can receive and send data in variety of formats JSON, XML, HTML, XHTML, Blob and more
  • 13. Web API The server is used only as API Each API Function is an endpoint in the server No need for server rendering No need for server routing
  • 15. Async Module Definitions (AMD) Define modules such that the module and its dependencies can be asynchronously loaded
  • 16. RequireJS Library A module framework in the browser Can be downloaded from http://requirejs.org/ Browser friendly API Supports NodeJS as well Defines a structure for files layout Uses conventions to perform lookups for dependencies
  • 18. MVC using BackboneJS BackboneJS is a small MV* library Enforces structure in your JavaScript code Includes only 5 main objects: Models Collections Views Routers Events
  • 19. MVC using BackboneJS – Cont. Extending one of BackboneJS main objects To have built-in BackboneJS functionality To create your own custom functionality var myModel = Backbone.Model.extend({ defaults: { myModelID: 0, myModelName: ‘’ } }); Var myCollection = Backbone.Collection.extend({ model: myModel }); var myRouter = Backbone.Router.extend({ routes: { ‘’: home }, home: function() { // create the home view } });
  • 22. Summary • SPAs are web apps built upon one page and JavaScript interactions Very suitable for mobile development • SPAs are the way to build your next web apps! •