SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 

Dernier (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 

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