SlideShare a Scribd company logo
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?

More Related Content

What's hot

White paper mbre_en
White paper mbre_enWhite paper mbre_en
White paper mbre_en
VisioneerUG
 
Spring boot
Spring bootSpring boot
Spring boot
Gyanendra Yadav
 
How to customize Spring Boot?
How to customize Spring Boot?How to customize Spring Boot?
How to customize Spring Boot?
GilWon Oh
 
Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot! Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot!
GlobalLogic Ukraine
 
Spring Boot and Microservices
Spring Boot and MicroservicesSpring Boot and Microservices
Spring Boot and Microservices
seges
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Trey Howard
 
When Camel Smiles
When Camel SmilesWhen Camel Smiles
When Camel Smiles
Orest Ivasiv
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué 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 Performance
Daniel 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 Istio
Ahmed Misbah
 
Oracle application testing suite online training
Oracle application testing suite online trainingOracle application testing suite online training
Oracle application testing suite online training
Glory IT Technologies Pvt. Ltd.
 
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
Daniel Merchán García
 
Java springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology MeetupJava springboot microservice - Accenture Technology Meetup
Java springboot microservice - Accenture Technology Meetup
Accenture 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 selenium
Wenhua Wang
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
IIS interview questions and answers
IIS interview questions and answersIIS interview questions and answers
IIS interview questions and answers
Interviewwiz
 
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...
Getting value from IoT, Integration and Data Analytics
 
AFNetworking
AFNetworking AFNetworking
AFNetworking
joaopmaia
 
Performance Testing in Oracle Apps
Performance Testing in Oracle AppsPerformance Testing in Oracle Apps
Performance Testing in Oracle Apps
Biswajit Pratihari
 

What's hot (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
 

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

XPages Mobile, #dd13
XPages Mobile, #dd13XPages 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
Pavel 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 development
webprogr.com
 
SamSegalResume
SamSegalResumeSamSegalResume
SamSegalResume
samuel segal
 
Hybrid application development
Hybrid application developmentHybrid application development
Hybrid application development
Engin Hatay
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
Pablo Godel
 
Build Database Applications for SharePoint
Build Database Applications for SharePointBuild Database Applications for SharePoint
Build Database Applications for SharePoint
Iron Speed
 
Build Database Applications for SharePoint!
Build Database Applications for SharePoint!Build Database Applications for SharePoint!
Build Database Applications for SharePoint!
Iron Speed
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
Carlo Bernaschina
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
Lars Vogel
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
Jussi Pohjolainen
 
Станислав Сидоренко «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 i
Zend by Rogue Wave Software
 
Sam segal resume
Sam segal resumeSam segal resume
Sam segal resume
samuel segal
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jaran Flaath
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
Eric Overfield
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
Sapna Upreti
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
Engine 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 applications
michaelaaron25322
 

Similar to 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 SharePointBuild 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 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
 

Recently uploaded

LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 

Recently uploaded (20)

LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 

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