Slide 1

Slide 1 text

@almadcz, @apiaryio Lukas Linhart CLIENT-CENTRIC API DEVELOPMENT Hi, I am Lukas @almadcz and I work for http://apiary.io.

Slide 2

Slide 2 text

We want API providers to stop inflicting pain on API consumers

Slide 3

Slide 3 text

Fancy way of exposing your database table. This is *not* a good design !

Slide 4

Slide 4 text

let me tell you why we do things, what keeps us up at night

Slide 5

Slide 5 text

You shouldn’t be egoistic and only look at your model of the world

Slide 6

Slide 6 text

CLIENT-CENTRIC Good API starts with good questions. How is your api going to be used?

Slide 7

Slide 7 text

It’s same as building business: find users/customers, validate & iterate.

Slide 8

Slide 8 text

You are going to find out about their culture.

Slide 9

Slide 9 text

You may find a quicky clients, but you should know what they want before saying no.

Slide 10

Slide 10 text

EXPRESSING INTENT Just write it as you would ask them in an e-mail, only with small markdown annotations (actually API Blueprint, http://apiblueprint.org/)

Slide 11

Slide 11 text

USER TESTING This blueprint (via apiary.io) gives you mock server, so you can foce your client to start developing.

Slide 12

Slide 12 text

Now you both can make prorotype—not only of API, but of the client application. That’s where the dragons lie: in user interaction. That’s where you going to find out about missing fields, bad resources…

Slide 13

Slide 13 text

…and you can iterate. Independently, having versioned text-file to talk in, and playing with the design (every client may even have multiple mock versions, sending pull-request after their idea is verified).

Slide 14

Slide 14 text

TDD/BDD DONE RIGHT • Usage of the (web) API first • intent - test (serving as documentation) - implement - watch for regressions • …documentation (serving as a test) The point of TDD is not to have test. The point is to think about what the given method should do and how it’s best invoked / used. ! This is the same on API level.

Slide 15

Slide 15 text

DREDD As for the last phase, dredd is a tool to verify blueprint is in sync with your implementation. Put this into your CI!

Slide 16

Slide 16 text

Start today and do baby steps. You don’t introduce tests into big project by big 100% coverage testing project— you start by covering the things you develop and refactor. ! Start doing this to your API now.

Slide 17

Slide 17 text

E-MAIL [email protected] TWITTER @apiaryio @apiblueprint Q&A

Slide 18

Slide 18 text

Photo Credit: victoriapeckham via Compfight cc Photo Credit: euthman via Compfight cc Photo Credit: AGraddyPhoto via Compfight cc Photo Credit: Colin_K via Compfight cc Photo Credit: loop_oh via Compfight cc Photo Credit: reynermedia via Compfight cc Photo Credit: Free Grunge Textures - www.freestock.ca via Compfight cc http://www.flickr.com/photos/raindrift/7095243379/in/set-72157629492908038 Photo Credit: josemanuelerre via Compfight cc Photo Credit: quapan via Compfight cc CREDITS