22
Kaminda Dimunge | SENIOR STAFF ENGINEER ZEBRA TECHNOLOGIES LANKA (PVT) LTD API Design Concepts for Device Programming

API Design Concepts for Device Programming

Embed Size (px)

Citation preview

Kaminda Dimunge | SENIOR STAFF ENGINEERZEBRA TECHNOLOGIES LANKA (PVT) LTD

API Design Concepts for Device Programming

Agenda

• Overview• API Types• Qualities of API• Configuration Models• Architecture• Design Considerations

2

Analogy of API design

Every car has a steering wheel, brake pedals, and an accelerator. You might find that hazard lights, the trunk release, or radio are slightly different, but it’s rare that an experienced driver can’t figure out how to drive a rental car.

-The authors of APIs: A Strategy Guide (Daniel Jacobson, Greg Brail, Dan Woods)

4

What is an API?

In computer programming, an application programming interface (API) is a set of routines, protocols, and tools for building software applications. …

-Wikipedia

5

6

Device Types

Mobile Devices

Control Sys-tems

Home Appli-ances

Public Safety

Healthcare De-vices

Wearable Devices

Automotive Comput-ers

Consider…

• Contains a display or not• Limited memory and processing

power• Input output• Stand-alone or connected• Communication secured or not• Security, safety compliances required • …

7

8

What can API do with devices?

• Get something done – Read a barcode

• Listen or monitor – Oil temperature of en-gine

• Watch – Is my dog eating the couch?

• Configure – Room temperature

• …

API Types

• Classic API – Common local APIs

• Design Time Controls – Like Button control

• Web APIs – Browser plug-ins etc.

• Provisioning and Staging APIs – for mass deployment, device profiling, licensing

• Software Wedge – Zero programming

• …

9

Internet of Things (IOT)

Qualities of API

• Learnability-Easy to learn, self descriptive, help, developer guide, wizards, IDE support, add-ons, plug-ins, intellisense, samples

• Usability-Key classes, patterns

• Robustness-Boundary checks, Type verification

• Performance-Actions within duration, memory, processor

• …• Eventually DX, UX

11

Design Patterns

-Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra

12

Configuration Models

Applications

Device

Device

Applications

Host

Connectivity

13

Standards

• Unified POS-OLE POS, Java POS, POS for .NET

• Web Services POS-WS-POS

• MagStripe Track Decoding-Master Card, Amex, Loyalty Card

• Barcode Label Types-Dutch Postal, PDF 417, UPC

• NFC, SmartCard, Payment etc.-NFC Type1, NFC Type 2, Memory Cards, CMU/MPU Cards

14

API Architecture

Connectivity

API Layer

Application

Device

Architecture 1

Service Layer

API Layer

Application

Device

Architecture 2

Application

Host

API Layer

Device

Architecture 1

15

Tunnelling, Active and Passive

Application 1

Application 3

Application 2 Host

Scanner 1

Scanner 2

Scanner 3

16

API Security

• Does your API only do what is intended?

• Is it accepting only the data as designed?

• Do you have any hidden APIs for internal with root access?

• Encryption and authentication adequate?

• …17

Concurrency

18

Synchronous vs. Asynchronous

• Limitations on synchronization• Avoid misuse• Mitigate delay and block

19

API Compatibility

• Application development contracted to outside companies

• Changes are costly– Positive test, Negative test, Stress test, Etc.– Deploy into thousands of devices in many

geographically different locations– User training

• Backward compatibility and forward compatibility

20

Compatibility

21

Thank You