RESTful APIs and FRAPI, a matter of minutes

67
RESTful APIs and FRAPI a matter of minutes @davidcoallier Dé Luain 20 Meán Fómhair 2010

Transcript of RESTful APIs and FRAPI, a matter of minutes

Page 1: RESTful APIs and FRAPI, a matter of minutes

RESTful APIs and FRAPIa matter of minutes

@davidcoallier

Dé Luain 20 Meán Fómhair 2010

Page 2: RESTful APIs and FRAPI, a matter of minutes

Who are you?Experiences, usage, etc.

Dé Luain 20 Meán Fómhair 2010

Page 3: RESTful APIs and FRAPI, a matter of minutes

Who am I?Work, experiences, usage, etc.

Dé Luain 20 Meán Fómhair 2010

Page 4: RESTful APIs and FRAPI, a matter of minutes

The Talk!Recap of why you are here...

Dé Luain 20 Meán Fómhair 2010

Page 5: RESTful APIs and FRAPI, a matter of minutes

Webservices?SOAP, XML-RPC, REST-ish, RESTful, etc...

Dé Luain 20 Meán Fómhair 2010

Page 6: RESTful APIs and FRAPI, a matter of minutes

RESTful!Introduction, History, Theory, Incentive.

Dé Luain 20 Meán Fómhair 2010

Page 7: RESTful APIs and FRAPI, a matter of minutes

Roy, Oh Roy....And it was born...

Dé Luain 20 Meán Fómhair 2010

Page 8: RESTful APIs and FRAPI, a matter of minutes

Client — Server!Talking architecture, representation, resources..

Dé Luain 20 Meán Fómhair 2010

Page 9: RESTful APIs and FRAPI, a matter of minutes

StatelessnessForget sessions, forget states.

Dé Luain 20 Meán Fómhair 2010

Page 10: RESTful APIs and FRAPI, a matter of minutes

LayeredLoad balancing, caching, ignorance.

Dé Luain 20 Meán Fómhair 2010

Page 11: RESTful APIs and FRAPI, a matter of minutes

CacheabilityRemember? Remember!

Dé Luain 20 Meán Fómhair 2010

Page 12: RESTful APIs and FRAPI, a matter of minutes

HomogeneityNegotiations, URIs, Collections, Resources

Dé Luain 20 Meán Fómhair 2010

Page 13: RESTful APIs and FRAPI, a matter of minutes

ConceptsRepresentations of resources, concepts

Consider a google search.

Dé Luain 20 Meán Fómhair 2010

Page 14: RESTful APIs and FRAPI, a matter of minutes

{ "search": "term", "count": 2, "items": [{ "title": "Item 1 Title", "href": "/link/1", "description": "Desc 1" }, { "title": "Item n title", "href": "/link/n", "description": "Desc n" }]}

Dé Luain 20 Meán Fómhair 2010

Page 15: RESTful APIs and FRAPI, a matter of minutes

UsabilityI hate frontends, but not usable software....

Dé Luain 20 Meán Fómhair 2010

Page 16: RESTful APIs and FRAPI, a matter of minutes

Collectionshttp://api.com/friends

Dé Luain 20 Meán Fómhair 2010

Page 17: RESTful APIs and FRAPI, a matter of minutes

Resourceshttp://api.com/friends/david

Dé Luain 20 Meán Fómhair 2010

Page 18: RESTful APIs and FRAPI, a matter of minutes

Good URIsYour URI is everything

Dé Luain 20 Meán Fómhair 2010

Page 19: RESTful APIs and FRAPI, a matter of minutes

Sentences“What if we make every URL a sentence?”

@shiflett

Dé Luain 20 Meán Fómhair 2010

Page 20: RESTful APIs and FRAPI, a matter of minutes

Quick RecapSo what have we talked about so far?

Dé Luain 20 Meán Fómhair 2010

Page 21: RESTful APIs and FRAPI, a matter of minutes

Want your CRUD?So you are missing your crud? Worry not!

Dé Luain 20 Meán Fómhair 2010

Page 22: RESTful APIs and FRAPI, a matter of minutes

HTTPIt’s got your back!

Dé Luain 20 Meán Fómhair 2010

Page 23: RESTful APIs and FRAPI, a matter of minutes

Really.. it does.

Dé Luain 20 Meán Fómhair 2010

Page 24: RESTful APIs and FRAPI, a matter of minutes

Verbs

Get

Post

Put

Delete

Create

Read

Update

Delete

CRUD

Dé Luain 20 Meán Fómhair 2010

Page 25: RESTful APIs and FRAPI, a matter of minutes

Fancy a header?Request what you need, when you want, how you want it

Dé Luain 20 Meán Fómhair 2010

Page 26: RESTful APIs and FRAPI, a matter of minutes

What?

Dé Luain 20 Meán Fómhair 2010

Page 27: RESTful APIs and FRAPI, a matter of minutes

Scenario I

Dé Luain 20 Meán Fómhair 2010

Page 28: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 29: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 30: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 31: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 32: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 33: RESTful APIs and FRAPI, a matter of minutes

Difference?Leveraging the architecture, no more ugliness

Dé Luain 20 Meán Fómhair 2010

Page 34: RESTful APIs and FRAPI, a matter of minutes

HATEOASHypermedia as the engine of application state

Dé Luain 20 Meán Fómhair 2010

Page 35: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 36: RESTful APIs and FRAPI, a matter of minutes

4 ConstraintsSeparation of resources from representationManipulation of resources by representations

Self-descriptive messagesHypermedia as the engine of application state

Dé Luain 20 Meán Fómhair 2010

Page 37: RESTful APIs and FRAPI, a matter of minutes

EntracteTime out. Time to get some drink, Q&A #1

Dé Luain 20 Meán Fómhair 2010

Page 38: RESTful APIs and FRAPI, a matter of minutes

FRAPIOh. My. Day!

Dé Luain 20 Meán Fómhair 2010

Page 39: RESTful APIs and FRAPI, a matter of minutes

What is it?Management panel & developer facing API

Dé Luain 20 Meán Fómhair 2010

Page 40: RESTful APIs and FRAPI, a matter of minutes

HistoryWhen? Where? Why? How?

Dé Luain 20 Meán Fómhair 2010

Page 41: RESTful APIs and FRAPI, a matter of minutes

Solves?Laziness, Performance Issues, Humans, TTM

Dé Luain 20 Meán Fómhair 2010

Page 42: RESTful APIs and FRAPI, a matter of minutes

It’s liveProduction system examples

Dé Luain 20 Meán Fómhair 2010

Page 43: RESTful APIs and FRAPI, a matter of minutes

FLUDYour iPad app newsreader

Dé Luain 20 Meán Fómhair 2010

Page 44: RESTful APIs and FRAPI, a matter of minutes

VodafoneFacebook apps

Dé Luain 20 Meán Fómhair 2010

Page 45: RESTful APIs and FRAPI, a matter of minutes

Open SourceProjects using FRAPI for their APIs

Dé Luain 20 Meán Fómhair 2010

Page 46: RESTful APIs and FRAPI, a matter of minutes

web2project

spaz

Dé Luain 20 Meán Fómhair 2010

Page 47: RESTful APIs and FRAPI, a matter of minutes

Entreprisehttp://echolibre.com

Dé Luain 20 Meán Fómhair 2010

Page 48: RESTful APIs and FRAPI, a matter of minutes

PerformanceBuilt with performance as primary goal.

Dé Luain 20 Meán Fómhair 2010

Page 49: RESTful APIs and FRAPI, a matter of minutes

Magic-lessFuck magic. There’s enough code out there

Dé Luain 20 Meán Fómhair 2010

Page 50: RESTful APIs and FRAPI, a matter of minutes

Few SetupsA few examples of possible FRAPI setups

Dé Luain 20 Meán Fómhair 2010

Page 51: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 52: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 53: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 54: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 55: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 56: RESTful APIs and FRAPI, a matter of minutes

ManagementWhere it all begins...

Dé Luain 20 Meán Fómhair 2010

Page 57: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 58: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 59: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 60: RESTful APIs and FRAPI, a matter of minutes

Dé Luain 20 Meán Fómhair 2010

Page 61: RESTful APIs and FRAPI, a matter of minutes

AuthenticationHTTP Digest, reasons and modification

Dé Luain 20 Meán Fómhair 2010

Page 62: RESTful APIs and FRAPI, a matter of minutes

DatabasesRDBMS, NoSQL, DBAL, ORM, etc.

Dé Luain 20 Meán Fómhair 2010

Page 63: RESTful APIs and FRAPI, a matter of minutes

NegotiateContent Negotiation and extensions

Dé Luain 20 Meán Fómhair 2010

Page 64: RESTful APIs and FRAPI, a matter of minutes

SynchronizeGeneration of your code.

Dé Luain 20 Meán Fómhair 2010

Page 65: RESTful APIs and FRAPI, a matter of minutes

DocumentationYour consumers need documentation

Dé Luain 20 Meán Fómhair 2010

Page 66: RESTful APIs and FRAPI, a matter of minutes

DevelopmentDecisions, business logic, software development

Dé Luain 20 Meán Fómhair 2010

Page 67: RESTful APIs and FRAPI, a matter of minutes

Q&A

Dé Luain 20 Meán Fómhair 2010