SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
Hyunghun Cho, Sukyoung Ryu
INTRODUCTION: The Web-centric Era
■ 『SAMSUNG DigitALL – everyone’s invited』&『Web of Things – everything’s invited』
INTRODUCTION: Web on embedded systems
■ Server enabled devices
■ Client enabled devices
MOTIVATION: Challenges of REST API on embedded system
■ Server side challenge
– design fully RESTful API
– standardized REST API among devices
– API maintainability & product lifecycle
– API quality assurance on various clients
■ Client side challenge
– difficulty to understand API domain
– REST API provide too low-level abstraction
– application maintainability to adapt
REST API change
HTTP
HTTP
Internet
REST API
REST API
Web Server Framework
Web Brower Web Runtime
JavaPHPJavaScript
JavaScript
…
HTML CSS …
MOTIVATION: Delegate to JavaScript API
■ Server side beneficial
– provides evolvability to fully RESTful API
– leverage standardized REST API
– Node.JS appears to develop server
using JavaScript
– API quality assurance to a target client
■ Client side beneficial
– JavaScript APIs are more friendlier
to client-side developers than REST APIs
– JavaScript APIs provide high-level
abstraction
– wrapper to map REST API to JavaScript
API can maintain the REST API change
HTTP
HTTP
Internet
REST API
REST API
Web Server Framework
Web Brower Web Runtime
JavaPHPJavaScript
JavaScript
…
HTML CSS …
OUR APPROACH: Design JavaScript API from REST API
■ 5 steps to design
① Collect use cases
of a REST API
② Extract states
of a client
③ Introduce
the entities
④ Add methods to
an entity
getRadius()
draw()
⑤ Design the method parameters
void draw(
unsigned short x,
unsigned short y,
SuccessCallback scb,
optional ErrorCallback ecb);
WebIDL Specification
CASE STUDY: N-Service API
■ N-Service API enables Multi-Screen Service Development
– allows Smart TV incorporating web platform and nearby mobile devices
■ System Architecture
– Inter-application communication w/ REST API & JavaScript API
Source: http://precious-forever.com/2011/05/26/patterns-for-multiscreen-strategies/
CASE STUDY: N-Service API
■ Step #1: Collect use cases of a REST API
Source: http://www.samsungdforum.com/
Guide/ref00003/convergence_app_client
totvappcomm.html
Method URI Use case
POST /ws/apps/{appId}/connect Connect to a host application
POST /ws/apps/{appId}/disconnect Disconnect from a host application
GET /ws/apps/{appId}/info
Get the information of a host
application
POST /ws/apps/{appId}/queue
Push a message to a host
application or upload a file
GET /ws/apps/{appId}/queue/devices/{deviceId}
Pop a message of a specific client
device from a host application
POST /ws/apps/{appId}/queue/devices/{deviceId}
Push a message to a specific client
device
POST /ws/apps/{appId}/queue/groups/{groupId}
Push a message to a specific
group
GET /ws/apps/{appId}/queue/groups/{groupId} Retrieve group members
POST
/ws/apps/{appId}/queue/groups/{groupId}
/join
Join a group
POST
/ws/apps/{appId}/queue/groups/{groupId}
/leave
Leave a group
CASE STUDY: N-Service API
■ Step #2: Extract possible states of a client and the state relationships
CASE STUDY: N-Service API
■ Step #3: Introduce an entity that is responsible for the extracted states and
there transitions
NServiceHostNServiceManager
NServiceDevice NServiceDeviceGroup
CASE STUDY: N-Service API
■ Step #4: Add state transitions as methods to the introduced entity
NServiceHostNServiceManager
NServiceDevice NServiceDeviceGroup
connectToNServiceHost()
joinGroup()
sendMessageToHost()
getHostInfo()
disconnect()
sendMessage()
leave()
getMembers()
CASE STUDY: N-Service API
■ Step #5: Make the number of method parameters smaller than the parameter
number of the corresponding REST API
[REST API]
POST /ws/app/{appId}/connect HTTP/1.1
SLDeviceID: 12345
VendorID: VendorMe
DeviceName: IE-Client
ProductID: SMARTDev
NServiceManager
connectToNServiceHost()
joinGroup()
sendMessageToHost()
[JavaScript API – synchronous (tentative)]
boolean connectNServiceHost(
DOMString appId,
DOMString slDeviceID,
DOMString deviceName,
DOMString productId
);
[JavaScript API – asynchronous]
[Constructor (NServiceHostInfoInit init)]
interface NServiceHostInfo {
attribute DOMString ipAddress;
attribute unsigned short portNumber;
attribute DOMString appID;
};
void connectNServiceHost(
NServiceHostInfo hostInfo,
NServiceHostConnectSuccessCallback
onsuccess,
optional ErrorCallback? Onerror
);
CASE STUDY: N-Service API
■ The order of JavaScript API calls for /connect operation
– NSeviceOwnDeviceInfo interface and corresponding methods are introduced.
CASE STUDY: N-Service API
■ Finally, JavaScript API works seamlessly both host and client side.
– below figure shows the ER diagram between client API & host API
CASE STUDY: N-Service API
■ Web applications using the JavaScript API
– Mash-up with Open API such as YouTube, flicker, ...
– Sources are freely available HERE
[Family Album]
[Puzzle game]
[YouTube Continue Play]
[Draw Together]
CASE STUDY: Lesson learned
■ A security issue using the REST API on CORS-aware browser
– W3C Cross Origin Resource Sharing
■ Usability Enhancement
– Object-oriented JavaScript API is more usable than REST API.
■ Code maintainability
– The client code using JavaScript API is more readable than directly invoking REST API.
■ Better documentation
– JavaScript API provides reasonable document as a REST API’s programming guide.
Feel free to contact me if you have any question
hyunghunny@gmail.com

Weitere ähnliche Inhalte

Was ist angesagt?

Service workers
Service workersService workers
Service workersjungkees
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker PresentationKyle Dorman
 
Introduction to AJAX In WordPress
Introduction to AJAX In WordPressIntroduction to AJAX In WordPress
Introduction to AJAX In WordPressCaldera Labs
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.jsRyan Anklam
 
遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016Caesar Chi
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!Chang W. Doh
 
Effective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingEffective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingRobert Munteanu
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionBertrand Delacretaz
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
Building RESTful APIs w/ Grape
Building RESTful APIs w/ GrapeBuilding RESTful APIs w/ Grape
Building RESTful APIs w/ GrapeDaniel Doubrovkine
 
Going Node At Netflix
Going Node At NetflixGoing Node At Netflix
Going Node At NetflixRyan Anklam
 
Thomas Lobinger
Thomas LobingerThomas Lobinger
Thomas LobingerCodeFest
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline WebBruno Oliveira
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingChris Love
 
Service Worker - Reliability bits
Service Worker - Reliability bitsService Worker - Reliability bits
Service Worker - Reliability bitsjungkees
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 

Was ist angesagt? (20)

JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
 
Service worker API
Service worker APIService worker API
Service worker API
 
Service workers
Service workersService workers
Service workers
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker Presentation
 
webworkers
webworkerswebworkers
webworkers
 
Introduction to AJAX In WordPress
Introduction to AJAX In WordPressIntroduction to AJAX In WordPress
Introduction to AJAX In WordPress
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
 
遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016遠端團隊專案建立與管理 remote team management 2016
遠端團隊專案建立與管理 remote team management 2016
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
 
Effective Web Application Development with Apache Sling
Effective Web Application Development with Apache SlingEffective Web Application Development with Apache Sling
Effective Web Application Development with Apache Sling
 
RESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 versionRESTful web apps with Apache Sling - 2013 version
RESTful web apps with Apache Sling - 2013 version
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Building RESTful APIs w/ Grape
Building RESTful APIs w/ GrapeBuilding RESTful APIs w/ Grape
Building RESTful APIs w/ Grape
 
Ruby On Grape
Ruby On GrapeRuby On Grape
Ruby On Grape
 
Going Node At Netflix
Going Node At NetflixGoing Node At Netflix
Going Node At Netflix
 
Thomas Lobinger
Thomas LobingerThomas Lobinger
Thomas Lobinger
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline Web
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker Caching
 
Service Worker - Reliability bits
Service Worker - Reliability bitsService Worker - Reliability bits
Service Worker - Reliability bits
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 

Ähnlich wie REST to JavaScript for Better Client-side Development

Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesEdwin Rojas
 
Svcc2009 Async Ws
Svcc2009 Async WsSvcc2009 Async Ws
Svcc2009 Async WsManoj Kumar
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Deepak Gupta
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jaojedt
 
Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack APIKrunal Jain
 
cross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecturecross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architectureOleksandr Tserkovnyi
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayAmazon Web Services
 
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Mobile Interface to CMS Based On HTML5 and Drupal: A Case StudyHima Javvadi
 
REST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxREST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxJason452803
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEORNodeXperts
 
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...CA Technologies
 
Vaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 editionVaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 editionJoonas Lehtinen
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testingPetrosPlakogiannis
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technologyMinal Maniar
 

Ähnlich wie REST to JavaScript for Better Client-side Development (20)

Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
Servlet
ServletServlet
Servlet
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Web api
Web apiWeb api
Web api
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL Webservices
 
Svcc2009 Async Ws
Svcc2009 Async WsSvcc2009 Async Ws
Svcc2009 Async Ws
 
Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)Real time Communication with Signalr (Android Client)
Real time Communication with Signalr (Android Client)
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jao
 
Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack API
 
cross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecturecross-platform-assets-based-front-end-architecture
cross-platform-assets-based-front-end-architecture
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study  Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
 
REST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxREST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptx
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEOR
 
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
Hands-On Lab: Managing and Monitoring Node.js Made Easy with CA Application P...
 
Vaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 editionVaadin Introduction, 7.3 edition
Vaadin Introduction, 7.3 edition
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
 
Java servlet technology
Java servlet technologyJava servlet technology
Java servlet technology
 

Mehr von Hyunghun Cho

2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?
2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?
2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?Hyunghun Cho
 
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여Hyunghun Cho
 
Tensorflow internal
Tensorflow internalTensorflow internal
Tensorflow internalHyunghun Cho
 
Do IoT Yourself 3rd : Open API - revision 3
Do IoT Yourself 3rd : Open API - revision 3Do IoT Yourself 3rd : Open API - revision 3
Do IoT Yourself 3rd : Open API - revision 3Hyunghun Cho
 
IoT Web App - 수집된 정보의 가공, 처리, 융합
IoT Web App - 수집된 정보의 가공, 처리, 융합IoT Web App - 수집된 정보의 가공, 처리, 융합
IoT Web App - 수집된 정보의 가공, 처리, 융합Hyunghun Cho
 
Do IoT Yourself! - 사물 간의 연결을 위한 Open API
Do IoT Yourself! - 사물 간의 연결을 위한 Open APIDo IoT Yourself! - 사물 간의 연결을 위한 Open API
Do IoT Yourself! - 사물 간의 연결을 위한 Open APIHyunghun Cho
 
IoT, 기술의 혁신과 미래 그리고 통찰
IoT, 기술의 혁신과 미래 그리고 통찰IoT, 기술의 혁신과 미래 그리고 통찰
IoT, 기술의 혁신과 미래 그리고 통찰Hyunghun Cho
 
GameTube app-swing-introduction
GameTube app-swing-introductionGameTube app-swing-introduction
GameTube app-swing-introductionHyunghun Cho
 
Home sensor prototype on Arduino & Raspberry Pi with Node.JS
Home sensor prototype on Arduino & Raspberry Pi with Node.JSHome sensor prototype on Arduino & Raspberry Pi with Node.JS
Home sensor prototype on Arduino & Raspberry Pi with Node.JSHyunghun Cho
 

Mehr von Hyunghun Cho (9)

2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?
2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?
2018 소프트웨어에 물들다 - 기계는 어떻게 생각할까?
 
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여
Somul 2017 소프트웨어, 사람과 사물의 소통을 향하여
 
Tensorflow internal
Tensorflow internalTensorflow internal
Tensorflow internal
 
Do IoT Yourself 3rd : Open API - revision 3
Do IoT Yourself 3rd : Open API - revision 3Do IoT Yourself 3rd : Open API - revision 3
Do IoT Yourself 3rd : Open API - revision 3
 
IoT Web App - 수집된 정보의 가공, 처리, 융합
IoT Web App - 수집된 정보의 가공, 처리, 융합IoT Web App - 수집된 정보의 가공, 처리, 융합
IoT Web App - 수집된 정보의 가공, 처리, 융합
 
Do IoT Yourself! - 사물 간의 연결을 위한 Open API
Do IoT Yourself! - 사물 간의 연결을 위한 Open APIDo IoT Yourself! - 사물 간의 연결을 위한 Open API
Do IoT Yourself! - 사물 간의 연결을 위한 Open API
 
IoT, 기술의 혁신과 미래 그리고 통찰
IoT, 기술의 혁신과 미래 그리고 통찰IoT, 기술의 혁신과 미래 그리고 통찰
IoT, 기술의 혁신과 미래 그리고 통찰
 
GameTube app-swing-introduction
GameTube app-swing-introductionGameTube app-swing-introduction
GameTube app-swing-introduction
 
Home sensor prototype on Arduino & Raspberry Pi with Node.JS
Home sensor prototype on Arduino & Raspberry Pi with Node.JSHome sensor prototype on Arduino & Raspberry Pi with Node.JS
Home sensor prototype on Arduino & Raspberry Pi with Node.JS
 

Kürzlich hochgeladen

Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESkarthi keyan
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmDeepika Walanjkar
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfNainaShrivastava14
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfisabel213075
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxStephen Sitton
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Industrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsIndustrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsAlirezaBagherian3
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 

Kürzlich hochgeladen (20)

Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdf
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptx
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Industrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsIndustrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal Compressors
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 

REST to JavaScript for Better Client-side Development

  • 2. INTRODUCTION: The Web-centric Era ■ 『SAMSUNG DigitALL – everyone’s invited』&『Web of Things – everything’s invited』
  • 3. INTRODUCTION: Web on embedded systems ■ Server enabled devices ■ Client enabled devices
  • 4. MOTIVATION: Challenges of REST API on embedded system ■ Server side challenge – design fully RESTful API – standardized REST API among devices – API maintainability & product lifecycle – API quality assurance on various clients ■ Client side challenge – difficulty to understand API domain – REST API provide too low-level abstraction – application maintainability to adapt REST API change HTTP HTTP Internet REST API REST API Web Server Framework Web Brower Web Runtime JavaPHPJavaScript JavaScript … HTML CSS …
  • 5. MOTIVATION: Delegate to JavaScript API ■ Server side beneficial – provides evolvability to fully RESTful API – leverage standardized REST API – Node.JS appears to develop server using JavaScript – API quality assurance to a target client ■ Client side beneficial – JavaScript APIs are more friendlier to client-side developers than REST APIs – JavaScript APIs provide high-level abstraction – wrapper to map REST API to JavaScript API can maintain the REST API change HTTP HTTP Internet REST API REST API Web Server Framework Web Brower Web Runtime JavaPHPJavaScript JavaScript … HTML CSS …
  • 6. OUR APPROACH: Design JavaScript API from REST API ■ 5 steps to design ① Collect use cases of a REST API ② Extract states of a client ③ Introduce the entities ④ Add methods to an entity getRadius() draw() ⑤ Design the method parameters void draw( unsigned short x, unsigned short y, SuccessCallback scb, optional ErrorCallback ecb); WebIDL Specification
  • 7. CASE STUDY: N-Service API ■ N-Service API enables Multi-Screen Service Development – allows Smart TV incorporating web platform and nearby mobile devices ■ System Architecture – Inter-application communication w/ REST API & JavaScript API Source: http://precious-forever.com/2011/05/26/patterns-for-multiscreen-strategies/
  • 8. CASE STUDY: N-Service API ■ Step #1: Collect use cases of a REST API Source: http://www.samsungdforum.com/ Guide/ref00003/convergence_app_client totvappcomm.html Method URI Use case POST /ws/apps/{appId}/connect Connect to a host application POST /ws/apps/{appId}/disconnect Disconnect from a host application GET /ws/apps/{appId}/info Get the information of a host application POST /ws/apps/{appId}/queue Push a message to a host application or upload a file GET /ws/apps/{appId}/queue/devices/{deviceId} Pop a message of a specific client device from a host application POST /ws/apps/{appId}/queue/devices/{deviceId} Push a message to a specific client device POST /ws/apps/{appId}/queue/groups/{groupId} Push a message to a specific group GET /ws/apps/{appId}/queue/groups/{groupId} Retrieve group members POST /ws/apps/{appId}/queue/groups/{groupId} /join Join a group POST /ws/apps/{appId}/queue/groups/{groupId} /leave Leave a group
  • 9. CASE STUDY: N-Service API ■ Step #2: Extract possible states of a client and the state relationships
  • 10. CASE STUDY: N-Service API ■ Step #3: Introduce an entity that is responsible for the extracted states and there transitions NServiceHostNServiceManager NServiceDevice NServiceDeviceGroup
  • 11. CASE STUDY: N-Service API ■ Step #4: Add state transitions as methods to the introduced entity NServiceHostNServiceManager NServiceDevice NServiceDeviceGroup connectToNServiceHost() joinGroup() sendMessageToHost() getHostInfo() disconnect() sendMessage() leave() getMembers()
  • 12. CASE STUDY: N-Service API ■ Step #5: Make the number of method parameters smaller than the parameter number of the corresponding REST API [REST API] POST /ws/app/{appId}/connect HTTP/1.1 SLDeviceID: 12345 VendorID: VendorMe DeviceName: IE-Client ProductID: SMARTDev NServiceManager connectToNServiceHost() joinGroup() sendMessageToHost() [JavaScript API – synchronous (tentative)] boolean connectNServiceHost( DOMString appId, DOMString slDeviceID, DOMString deviceName, DOMString productId ); [JavaScript API – asynchronous] [Constructor (NServiceHostInfoInit init)] interface NServiceHostInfo { attribute DOMString ipAddress; attribute unsigned short portNumber; attribute DOMString appID; }; void connectNServiceHost( NServiceHostInfo hostInfo, NServiceHostConnectSuccessCallback onsuccess, optional ErrorCallback? Onerror );
  • 13. CASE STUDY: N-Service API ■ The order of JavaScript API calls for /connect operation – NSeviceOwnDeviceInfo interface and corresponding methods are introduced.
  • 14. CASE STUDY: N-Service API ■ Finally, JavaScript API works seamlessly both host and client side. – below figure shows the ER diagram between client API & host API
  • 15. CASE STUDY: N-Service API ■ Web applications using the JavaScript API – Mash-up with Open API such as YouTube, flicker, ... – Sources are freely available HERE [Family Album] [Puzzle game] [YouTube Continue Play] [Draw Together]
  • 16. CASE STUDY: Lesson learned ■ A security issue using the REST API on CORS-aware browser – W3C Cross Origin Resource Sharing ■ Usability Enhancement – Object-oriented JavaScript API is more usable than REST API. ■ Code maintainability – The client code using JavaScript API is more readable than directly invoking REST API. ■ Better documentation – JavaScript API provides reasonable document as a REST API’s programming guide.
  • 17. Feel free to contact me if you have any question hyunghunny@gmail.com