decouple your mobile api now

19
Decouple your mobile API now …don’t be sorry later ! Sept 2013 Romain Prieto

Upload: romain-prieto

Post on 15-Aug-2015

26 views

Category:

Technology


0 download

TRANSCRIPT

Decouple yourmobile API now

…don’t be sorry later !

Sept 2013Romain Prieto

BREAKING CHANGE

defensive / fallbacks

continuous checks

consumer-driver contracts

Display list of products

sorted by MagicRank ©

unless on sale

only best rated

Where does that logic sit?

Even if it’s UI related…

will you want to tweak it remotely?

Custom tailored

services

Many

capabilities

GET

/products

{ id: 1, name:

“chair” },

{ id: 2, name:

“table” }

GET

/products/1

{ price: 30, image:

“…” }

POST

/cart/items{ productId: 1,

quantity: 4 }

URI changes? …refactoring

Host changes? …micro-services

…infrastructure

upgrades

GET

/products

[{

id: 1,

name: “chair”,

details:

“/products/1”

}]

DATA

GET /config

{ cart:

“/cart/items” }

GET

/products/1{ cart: “/cart/items/1“, … }

SERVICES

or

SINGLE

PROXY

DISCOVERABLE

SERVICES

http://mark-kirby.co.uk/2013/creating-a-true-rest-api/

http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

http://madhatted.com/2013/3/19/suggested-rest-api-practices

http://offers.apigee.com/web-api-design-ebook/

http://kinderman.net/2010/06/23/approaching-pure-rest-learning-to-love-hateoas

http://stateless.co/hal_specification.html

https://kenai.com/projects/suncloudapis/pages/CloudAPIBackupRequests

a few more URLs

{ "op": "restore-Backup", "progress": 0, "target_uri": "/vms/33333/backups/456", "status_uri": "/statuses?op=restore-Backup&vm=3&b=456"}

SunCloud API (2009)

<link href="http://api-public.netflix.com/catalog/titles/series/70023522/cast" rel="http://schemas.netflix.com/catalog/people" title="cast">

<cast>

<link href="http://api-public.netflix.com/catalog/people/30011713" rel="http://schemas.netflix.com/catalog/person" title="Steve Carell” />

<link href="http://api-public.netflix.com/catalog/people/30014922" rel="http://schemas.netflix.com/catalog/person" title="John Krasinski” />

Netflix