Slide 1

Slide 1 text

API DRIVEN DEVELOPMENT Or; Eating Your Own Dog Food

Slide 2

Slide 2 text

NICK JACKSON @jacksonj04

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

APIS HAVE MADE US: • Smarter • More Responsive • Faster • Better at what we do • Produce a better user experience

Slide 5

Slide 5 text

IN TODAY’S LECTURE... • What is an API? • How can I use it to drive development? • Why should I care? • How CodeIgniter made it easy.

Slide 6

Slide 6 text

WHAT IS AN API? A Really Quick Introduction

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

DRIVEN BY APIS Planning For The Win

Slide 11

Slide 11 text

Fancy Web Service NOW WITH AN API!!!*

Slide 12

Slide 12 text

We Have An API!* ❖ API only available on Triple Platinum Plus plan. ❖ API allows reading of content only, not creation, modification or deletion. ❖ API will not be kept up to date with new changes. ❖ No support or documentation is available for API. ❖ API may randomly stop working, and we won’t really care about fixing it for you. After all, it’s not important.

Slide 13

Slide 13 text

Database Application User

Slide 14

Slide 14 text

3rd Party Application User API Database Application User

Slide 15

Slide 15 text

THE SOLUTION?

Slide 16

Slide 16 text

Database API

Slide 17

Slide 17 text

3rd Party Application User Application User Database API

Slide 18

Slide 18 text

EAT YOUR OWN DOG FOOD

Slide 19

Slide 19 text

YAY FOR APIS! But why should I care?

Slide 20

Slide 20 text

ARCHITECTURE IS BETTER • Forced to think about data types and methods early on. • Consistent behaviour across application is easier to achieve.

Slide 21

Slide 21 text

DEVELOPMENT IS EASIER • Calling a well designed API is simple. • Error messages become cleanly captured by design. • APIs encourage code reuse at both API and application end.

Slide 22

Slide 22 text

UPDATES BECOME SIMPLER • Run two or more API versions concurrently. • Tweak API backend and all frontends (‘official’ and 3rd party) benefit at once.

Slide 23

Slide 23 text

YOUR API WILL BE BETTER • API must include everything you want your application to be able to do. • Reliability of API is now critical. • Documentation is better.

Slide 24

Slide 24 text

SO WHAT OF CODEIGNITER? Why CodeIgniter already has you thinking the right way

Slide 25

Slide 25 text

View Model Controller

Slide 26

Slide 26 text

API Model Controller View API Controller

Slide 27

Slide 27 text

HELPFUL OUT OF THE BOX • PHP is built to work in a web environment, so functions to GET, POST etc are really simple. • Output class has caching, media types and so-on. • Upcoming in v3: Unit testing (and other goodies)

Slide 28

Slide 28 text

LIBRARIES AND EXTENDABILITY • Awesome libraries out there already. • Many, many tutorials out there already. • Google it, try “CodeIgniter REST / OAuth / API” etc. • Really easy to extend output class to do custom API stuff.