SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Taking Your “Web” App 
To places you never expected 
Garth Williams 
@williamsgarth 
IAEA 
International Atomic Energy Agency
IAEA 
Introduction 
IAEA Headquarters in Vienna 
http://iaea.org
IAEA 
Background 
• The IAEA inspects nuclear facilities all over the world 
• The IAEA is currently modernising a number of legacy applications 
• Our inspectors need to collect and store data where no network 
connection is guaranteed or even allowed 
• Our team is writing the next version of software for facility inspections
IAEA 
Let’s use WPF? 
• A desktop app is the logical choice, right? 
• Organisation standards are based on Microsoft technologies 
• So Windows Presentation Foundation must be the right choice? 
• (Oh, by the way, we may need to support tablets in 2015)
IAEA 
Why HTML(5) is better 
• HTML5 includes all the building blocks for offline apps 
• Web apps don’t need to be installed 
• HTML is portable
IAEA 
Ember is a good fit 
• Full stack framework 
• Well suited to larger projects: 
• Ember offers familiar conventions 
• Ember encourages consistency and structure through the 
use of components, ember data, stateful routing, etc… 
• Compiles down to one or two js distributables
IAEA 
Taking ember offline 
(manifest.appcache) 
• Use a manifest file 
• Lists all resources needed when offline 
• CSS, Fonts, Images, JavaScript, HTML, etc… 
• Referenced in your html tag 
<!DOCTYPE*html>* 
<html*manifest=“/manifest.appcache”>* 
**…* 
</html>
IAEA 
Taking ember offline 
(manifest.appcache) 
CACHE*MANIFEST* 
#-Version-1.0.0- 
! 
CACHE:* 
/js/app.js* 
/css/app.css* 
/images/logo.png* 
/fonts/fontawesomeJwebfont.woff* 
/404.html* 
! 
NETWORK:* 
/api* 
! 
FALLBACK:* 
/*/404.html
IAEA 
What about my beautiful 
client side URLs? 
• Single page apps used to use # for client side routing 
• For an app is located at 
• https://stunningapp.com/ 
• When the client navigates to entity 5 then we can have 
• https://stunningapp.com/#/entity/5
IAEA 
What about my beautiful 
client side URLs? 
• But now I’m using push state, how can this dynamic url be 
available offline? 
• https://stunningapp.com/entity/5/
IAEA 
What about my beautiful 
client side URLs? 
• Use the FALLBACK section of the manifest file 
CACHE*MANIFEST* 
! 
CACHE:* 
/* 
! 
FALLBACK:* 
#-normal-fallback:-/-/404.html- 
#-Support-Push-State- 
/*/ 
• Any page not stored locally will return the cached root page
IAEA 
Caching hell 
& double reloads 
• First time a browser visits your app: 
1. HTML is downloaded 
2. Manifest is detected and downloaded 
3. Resources listed in manifest are downloaded and stored
IAEA 
Caching hell 
& double reloads 
• On subsequent visits: 
1. Cached version of all app files are used 
• Fast load time! 
• Potentially out of date! 
2. Check if manifest file has changed
IAEA 
Caching hell 
& double reloads 
• Manifest is only checked on first load 
• Long running apps won’t know there’s a new version 
• Only the manifest file is checked 
• Changes in other files will not be detected 
• If there is a new version it will be silently downloaded 
• User is not automatically informed 
• Changes are not applied until reload
IAEA 
Caching hell 
& double reloads 
• Mitigation: 
1. Auto-generate the manifest 
• Put a content hash of cached files in a comment 
CACHE*MANIFEST* 
! 
CACHE:* 
#-app.js-hash:-1921ec2e922f7f11c73c870e908b1c50- 
/js/app.js
IAEA 
Caching hell 
& double reloads 
• Mitigation: 
2. Notify the user 
applicationCache.addEventListener('updateready',*function*()*{* 
**//*let*the*user*know*that*they*need*to*reload* 
});
IAEA 
Caching hell 
& double reloads 
• During development you may spend a lot of time reloading the app 
• 1 reload is not enough 
• 1st reload will download the changes 
• 2nd will put them into effect 
• 2 reloads is tedious 
• If you reload too quickly it might not work
IAEA 
Caching hell 
& double reloads 
• Mitigation: 
3. Periodically check for a new version 
setInterval(function*()*{* 
**applicationCache.update();* 
},*config.newVersionCheckInterval); 
• If the manifest has changed then it will be downloaded in the 
background
IAEA 
Toggle online only features 
• Some features require a server 
• We can check network connection status 
• Also need to check if the server can be reached
IAEA 
Toggle online only features 
• Detecting network availability 
var*updateNetworkStatus*=*function*()*{* 
**if*(applicationController.get('isNetworkConnected')*!==*navigator.onLine)*{* 
****applicationController.set('isNetworkConnected',*navigator.onLine);* 
****//*if*we*just*moved*from*offline*to*online*check*for*app*update* 
****if*(navigator.onLine)*{* 
******applicationCache.update();* 
****}* 
**}* 
};* 
window.addEventListener('online',*updateNetworkStatus);* 
window.addEventListener('offline',*updateNetworkStatus);
IAEA 
Toggle online only features 
• Detecting service availability 
var*updateServiceStatus*=*function*(status)*{* 
**applicationController.set('isServiceAvailable',*status.type*!==*'error');* 
};* 
! 
applicationCache.addEventListener('error',*updateServiceStatus);* 
applicationCache.addEventListener('noupdate',*updateServiceStatus);* 
applicationCache.addEventListener('updateready',*updateServiceStatus);
IAEA 
Toggle online only features 
• Putting network and service status together 
isOnline:*function*()*{* 
**return*this.get('isNetworkConnected')*&&*this.get('isServiceAvailable');* 
}.property('isNetworkConnected',*'isServiceAvailable')
IAEA 
Data Access 
• Ember data offers useful layered abstractions 
• An adaptor lets you communicate with your data source 
• A serialiser lets you transform from the format of your source to the 
format expected by ember 
• The store provides an agnostic API for application to load and save 
models
IAEA 
Data Access 
• Server side we’re using ASP.NET MVC Web API 
• Requires a custom Adaptor and Serialiser 
• Adding offline support at the adaptor level is easy 
• Application code does not need know
IAEA 
Data Access 
• Oversimplified data adaptor 
var*CacheAdapter*=*DS.RESTAdapter.extend({* 
**ajax:*function*(url,*type,*options)*{* 
****if*(App.get('isOnline'))*{* 
******options.success*=*function*(responseData)*{* 
********cacheResponse(url,*type,*options,*responseData);* 
******};* 
******return*this._super(url,*type,*options);* 
****}*else*{* 
******return*cachedResponse(url,*type,*options);* 
****}* 
**}* 
});
IAEA 
Data Access 
• Not always desirable to cache every response 
• Pass intentions to store methods
IAEA 
Data Access 
store.findById('person',*id,*{*cacheResponse:*true*}); 
var*CacheStore*=*DS.Store.extend({* 
**findById:*function*(type,*id,*options)*{* 
****return*this.findQuery(type,*{*id:*id*},*options).then(function*(result)*{* 
******return*result.get('firstObject');* 
****});* 
**},* 
! 
**findQuery:*function*(type,*data,*options)*{* 
****data*=*data*||*{};* 
****data.__options*=*options*||*{};* 
****return*this._super(type,*data);* 
**}* 
});
IAEA 
Hold on… “new” requirement 
• We forgot to mention… 
• Sometimes it’s not possible to bring the laptop/tablet back to 
headquarters 
• How can you deploy and update a web app to a computer that never 
connects to the server?
IAEA 
Hold on… “new” requirement 
• At a small number of locations, the only hardware allowed back to 
HQ is a hardware encrypted USB stick… 
• Put the browser on the USB stick 
• Configure the browser to store all data cache data on the USB 
• Now when at HQ the browser will update the app and store data 
needed ready for offline use
IAEA 
Recap 
• Ember offers the structure necessary for large (and small) projects 
• Build tools like ember-cli give you manageable output for 
manifest.appcache and can easily be extended to automate its content 
• Build automation is essential from the start when using appcache 
• Ember data has the abstractions necessary to provide good offline 
support which can be transparent to your app 
• There’s not much that you can’t do with Ember.js “web” application
IAEA 
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

White paper mbre_en
White paper mbre_enWhite paper mbre_en
White paper mbre_enVisioneerUG
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?GilWon Oh
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservicesseges
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring BootTrey Howard
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
NLOUG 2017- Oracle WebCenter Portal 12c Performance
NLOUG 2017- Oracle WebCenter Portal 12c PerformanceNLOUG 2017- Oracle WebCenter Portal 12c Performance
NLOUG 2017- Oracle WebCenter Portal 12c PerformanceDaniel Merchán García
 
Microservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioMicroservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioAhmed Misbah
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupAccenture Hungary
 
O - Oracle application testing suite test starter kits for oracle e business ...
O - Oracle application testing suite test starter kits for oracle e business ...O - Oracle application testing suite test starter kits for oracle e business ...
O - Oracle application testing suite test starter kits for oracle e business ...Satya Harish
 
Deployment automation framework with selenium
Deployment automation framework with seleniumDeployment automation framework with selenium
Deployment automation framework with seleniumWenhua Wang
 
IIS interview questions and answers
IIS interview questions and answersIIS interview questions and answers
IIS interview questions and answersInterviewwiz
 
AFNetworking
AFNetworking AFNetworking
AFNetworking joaopmaia
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle AppsBiswajit Pratihari
 

Was ist angesagt? (20)

White paper mbre_en
White paper mbre_enWhite paper mbre_en
White paper mbre_en
 
Spring boot
Spring bootSpring boot
Spring boot
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?
 
Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot! Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot!
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
When Camel Smiles
When Camel SmilesWhen Camel Smiles
When Camel Smiles
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
NLOUG 2017- Oracle WebCenter Portal 12c Performance
NLOUG 2017- Oracle WebCenter Portal 12c PerformanceNLOUG 2017- Oracle WebCenter Portal 12c Performance
NLOUG 2017- Oracle WebCenter Portal 12c Performance
 
Microservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and IstioMicroservice test strategies for applications based on Spring, K8s and Istio
Microservice test strategies for applications based on Spring, K8s and Istio
 
Oracle application testing suite online training
Oracle application testing suite online trainingOracle application testing suite online training
Oracle application testing suite online training
 
NLOUG 2018 - Future of JSF and ADF
NLOUG 2018 - Future of JSF and ADFNLOUG 2018 - Future of JSF and ADF
NLOUG 2018 - Future of JSF and ADF
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
 
O - Oracle application testing suite test starter kits for oracle e business ...
O - Oracle application testing suite test starter kits for oracle e business ...O - Oracle application testing suite test starter kits for oracle e business ...
O - Oracle application testing suite test starter kits for oracle e business ...
 
Deployment automation framework with selenium
Deployment automation framework with seleniumDeployment automation framework with selenium
Deployment automation framework with selenium
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
IIS interview questions and answers
IIS interview questions and answersIIS interview questions and answers
IIS interview questions and answers
 
Real-World Load Testing of ADF Fusion Applications Demonstrated - Oracle Ope...
Real-World Load Testing of ADF Fusion Applications Demonstrated  - Oracle Ope...Real-World Load Testing of ADF Fusion Applications Demonstrated  - Oracle Ope...
Real-World Load Testing of ADF Fusion Applications Demonstrated - Oracle Ope...
 
AFNetworking
AFNetworking AFNetworking
AFNetworking
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle Apps
 

Ähnlich wie Taking your “web” app to places you never expected - Ember Fest 2014

Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Pavel Chunyayev
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Ryan Cuprak
 
Apache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentApache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentwebprogr.com
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application developmentEngin Hatay
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 
Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Iron Speed
 
Build Database Applications for SharePoint
Build Database Applications for SharePointBuild Database Applications for SharePoint
Build Database Applications for SharePointIron Speed
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»DataArt
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM iZend by Rogue Wave Software
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartEric Overfield
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteorSapna Upreti
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsmichaelaaron25322
 

Ähnlich wie Taking your “web” app to places you never expected - Ember Fest 2014 (20)

XPages Mobile, #dd13
XPages Mobile, #dd13XPages Mobile, #dd13
XPages Mobile, #dd13
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
Apache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app developmentApache Cordova phonegap plugins for mobile app development
Apache Cordova phonegap plugins for mobile app development
 
SamSegalResume
SamSegalResumeSamSegalResume
SamSegalResume
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Build Database Applications for SharePoint!
Build Database Applications for SharePoint!
 
Build Database Applications for SharePoint
Build Database Applications for SharePointBuild Database Applications for SharePoint
Build Database Applications for SharePoint
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
 
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
 
Building and managing applications fast for IBM i
Building and managing applications fast for IBM iBuilding and managing applications fast for IBM i
Building and managing applications fast for IBM i
 
Sam segal resume
Sam segal resumeSam segal resume
Sam segal resume
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 

Kürzlich hochgeladen

%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 

Kürzlich hochgeladen (20)

%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Taking your “web” app to places you never expected - Ember Fest 2014

  • 1. Taking Your “Web” App To places you never expected Garth Williams @williamsgarth IAEA International Atomic Energy Agency
  • 2. IAEA Introduction IAEA Headquarters in Vienna http://iaea.org
  • 3. IAEA Background • The IAEA inspects nuclear facilities all over the world • The IAEA is currently modernising a number of legacy applications • Our inspectors need to collect and store data where no network connection is guaranteed or even allowed • Our team is writing the next version of software for facility inspections
  • 4. IAEA Let’s use WPF? • A desktop app is the logical choice, right? • Organisation standards are based on Microsoft technologies • So Windows Presentation Foundation must be the right choice? • (Oh, by the way, we may need to support tablets in 2015)
  • 5. IAEA Why HTML(5) is better • HTML5 includes all the building blocks for offline apps • Web apps don’t need to be installed • HTML is portable
  • 6. IAEA Ember is a good fit • Full stack framework • Well suited to larger projects: • Ember offers familiar conventions • Ember encourages consistency and structure through the use of components, ember data, stateful routing, etc… • Compiles down to one or two js distributables
  • 7. IAEA Taking ember offline (manifest.appcache) • Use a manifest file • Lists all resources needed when offline • CSS, Fonts, Images, JavaScript, HTML, etc… • Referenced in your html tag <!DOCTYPE*html>* <html*manifest=“/manifest.appcache”>* **…* </html>
  • 8. IAEA Taking ember offline (manifest.appcache) CACHE*MANIFEST* #-Version-1.0.0- ! CACHE:* /js/app.js* /css/app.css* /images/logo.png* /fonts/fontawesomeJwebfont.woff* /404.html* ! NETWORK:* /api* ! FALLBACK:* /*/404.html
  • 9. IAEA What about my beautiful client side URLs? • Single page apps used to use # for client side routing • For an app is located at • https://stunningapp.com/ • When the client navigates to entity 5 then we can have • https://stunningapp.com/#/entity/5
  • 10. IAEA What about my beautiful client side URLs? • But now I’m using push state, how can this dynamic url be available offline? • https://stunningapp.com/entity/5/
  • 11. IAEA What about my beautiful client side URLs? • Use the FALLBACK section of the manifest file CACHE*MANIFEST* ! CACHE:* /* ! FALLBACK:* #-normal-fallback:-/-/404.html- #-Support-Push-State- /*/ • Any page not stored locally will return the cached root page
  • 12. IAEA Caching hell & double reloads • First time a browser visits your app: 1. HTML is downloaded 2. Manifest is detected and downloaded 3. Resources listed in manifest are downloaded and stored
  • 13. IAEA Caching hell & double reloads • On subsequent visits: 1. Cached version of all app files are used • Fast load time! • Potentially out of date! 2. Check if manifest file has changed
  • 14. IAEA Caching hell & double reloads • Manifest is only checked on first load • Long running apps won’t know there’s a new version • Only the manifest file is checked • Changes in other files will not be detected • If there is a new version it will be silently downloaded • User is not automatically informed • Changes are not applied until reload
  • 15. IAEA Caching hell & double reloads • Mitigation: 1. Auto-generate the manifest • Put a content hash of cached files in a comment CACHE*MANIFEST* ! CACHE:* #-app.js-hash:-1921ec2e922f7f11c73c870e908b1c50- /js/app.js
  • 16. IAEA Caching hell & double reloads • Mitigation: 2. Notify the user applicationCache.addEventListener('updateready',*function*()*{* **//*let*the*user*know*that*they*need*to*reload* });
  • 17. IAEA Caching hell & double reloads • During development you may spend a lot of time reloading the app • 1 reload is not enough • 1st reload will download the changes • 2nd will put them into effect • 2 reloads is tedious • If you reload too quickly it might not work
  • 18. IAEA Caching hell & double reloads • Mitigation: 3. Periodically check for a new version setInterval(function*()*{* **applicationCache.update();* },*config.newVersionCheckInterval); • If the manifest has changed then it will be downloaded in the background
  • 19. IAEA Toggle online only features • Some features require a server • We can check network connection status • Also need to check if the server can be reached
  • 20. IAEA Toggle online only features • Detecting network availability var*updateNetworkStatus*=*function*()*{* **if*(applicationController.get('isNetworkConnected')*!==*navigator.onLine)*{* ****applicationController.set('isNetworkConnected',*navigator.onLine);* ****//*if*we*just*moved*from*offline*to*online*check*for*app*update* ****if*(navigator.onLine)*{* ******applicationCache.update();* ****}* **}* };* window.addEventListener('online',*updateNetworkStatus);* window.addEventListener('offline',*updateNetworkStatus);
  • 21. IAEA Toggle online only features • Detecting service availability var*updateServiceStatus*=*function*(status)*{* **applicationController.set('isServiceAvailable',*status.type*!==*'error');* };* ! applicationCache.addEventListener('error',*updateServiceStatus);* applicationCache.addEventListener('noupdate',*updateServiceStatus);* applicationCache.addEventListener('updateready',*updateServiceStatus);
  • 22. IAEA Toggle online only features • Putting network and service status together isOnline:*function*()*{* **return*this.get('isNetworkConnected')*&&*this.get('isServiceAvailable');* }.property('isNetworkConnected',*'isServiceAvailable')
  • 23. IAEA Data Access • Ember data offers useful layered abstractions • An adaptor lets you communicate with your data source • A serialiser lets you transform from the format of your source to the format expected by ember • The store provides an agnostic API for application to load and save models
  • 24. IAEA Data Access • Server side we’re using ASP.NET MVC Web API • Requires a custom Adaptor and Serialiser • Adding offline support at the adaptor level is easy • Application code does not need know
  • 25. IAEA Data Access • Oversimplified data adaptor var*CacheAdapter*=*DS.RESTAdapter.extend({* **ajax:*function*(url,*type,*options)*{* ****if*(App.get('isOnline'))*{* ******options.success*=*function*(responseData)*{* ********cacheResponse(url,*type,*options,*responseData);* ******};* ******return*this._super(url,*type,*options);* ****}*else*{* ******return*cachedResponse(url,*type,*options);* ****}* **}* });
  • 26. IAEA Data Access • Not always desirable to cache every response • Pass intentions to store methods
  • 27. IAEA Data Access store.findById('person',*id,*{*cacheResponse:*true*}); var*CacheStore*=*DS.Store.extend({* **findById:*function*(type,*id,*options)*{* ****return*this.findQuery(type,*{*id:*id*},*options).then(function*(result)*{* ******return*result.get('firstObject');* ****});* **},* ! **findQuery:*function*(type,*data,*options)*{* ****data*=*data*||*{};* ****data.__options*=*options*||*{};* ****return*this._super(type,*data);* **}* });
  • 28. IAEA Hold on… “new” requirement • We forgot to mention… • Sometimes it’s not possible to bring the laptop/tablet back to headquarters • How can you deploy and update a web app to a computer that never connects to the server?
  • 29. IAEA Hold on… “new” requirement • At a small number of locations, the only hardware allowed back to HQ is a hardware encrypted USB stick… • Put the browser on the USB stick • Configure the browser to store all data cache data on the USB • Now when at HQ the browser will update the app and store data needed ready for offline use
  • 30. IAEA Recap • Ember offers the structure necessary for large (and small) projects • Build tools like ember-cli give you manageable output for manifest.appcache and can easily be extended to automate its content • Build automation is essential from the start when using appcache • Ember data has the abstractions necessary to provide good offline support which can be transparent to your app • There’s not much that you can’t do with Ember.js “web” application