Upgrade to Pro — share decks privately, control downloads, hide ads and more …

API First (ZendCon 2013)

API First (ZendCon 2013)

A recent theme among web creators is the notion of mobile first. It's the idea that we should design first for the mobile experience. Throw in the concepts of progressive enhancement and responsive design, and we have some excellent approaches to interface design and development. But where does that leave the overall software design? How do we get all the data to the interface and manipulate it without building a lot of back-end scripts to drive the various front-end incarnations? A centralized API will solve these problems, but we're often scrambling to implement the "mobile first" strategy on top of existing code. For good web software design, it's time to start thinking in terms of API first. In this talk, Ben Ramsey pulls from his experience making APIs to discuss how you can begin projects with an API-centric mindset and use this to your advantage to deliver software quickly, more efficiently, and with higher quality. If you already have projects that began life without APIs, then have no fear. Ben will also share how to use the same principles to convert existing web applications to API-backed software with some elbow grease, of course.

0c217b9a7dd0aa31ed40bd0f453727e1?s=128

Ben Ramsey
PRO

October 10, 2013
Tweet

Transcript

  1. API First Ben Ramsey

  2. None
  3. None
  4. 6 billion mobile subscriptions globally

  5. 6 BILLION!!!

  6. None
  7. None
  8. Website MVC Templates Static Assets Database

  9. 6 BILLION!!!

  10. Website & Mobile MVC Templates Static Assets Database Mobile Templates

    Separate Mobile MVC Templates Static Assets Database Website & Mobile MVC Templates Static Assets Database Mobile Templates Mobi MVC
  11. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database
  12. None
  13. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  14. None
  15. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  16. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  17. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  18. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  19. None
  20. “A big ball of mud is haphazardly structured, sprawling, sloppy,

    duct-tape and bailing wire, spaghetti code jungle. We’ve all seen them. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated. The overall structure of the system may never have been well defined. If it was, it may have eroded beyond recognition.” — Brian Foote and Joseph Yoder, laputan.org/mud
  21. Start with the API first

  22. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  23. Start with the API first

  24. 1. Separation of concerns

  25. API Layer UI 1 UI 2 UI 3

  26. 2. Scalable

  27. 2a. Team

  28. 2b. Product

  29. 2c. Business

  30. 2d. Technology

  31. API Layer UI 1 UI 2 UI 3 Users Assets

    Products Trx
  32. 3. Extensible

  33. 4. Seamless

  34. 5. Evolvable

  35. SOLID

  36. 1. Single responsibility

  37. 2. Open/closed

  38. 3. Liskov substitution

  39. Client Service 1 Service 2 Service 3

  40. Client Service 1 Service 2 Service 3

  41. 4. Interface segregation

  42. 5. Dependency inversion

  43. Client Service 1 Service 2 Service 3

  44. Service-oriented architecture

  45. Representational State Transfer (REST)

  46. 1. Client-server 2. Stateless 3. Cacheable 4. Layered system 5.

    Code on demand 6. Uniform interface
  47. None
  48. API Layer Native App Website Mobile Users Assets Products Trx

    Database
  49. What about “legacy” code?

  50. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database Native App API Native App
  51. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database API Layer Native App
  52. Mobile MVC Templates Static Assets Website MVC Templates Static Assets

    Database API Layer Native App
  53. But how do we “sell” it within our company?

  54. 1. Show how it adds value, increases throughput, and decreases

    time to implement change requests and new features 2. Demo a working prototype 3. Do this with a presentation 4. Tell a convincing story 5. Create a roadmap 6. Get help from a co-worker, boss, or mentor
  55. Ben Ramsey benramsey.com @ramsey joind.in/9094 Thank you

  56. API First Copyright © Ben Ramsey. Some rights reserved. This

    work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivs 3.0 Unported. For uses not covered under this license, please contact the author. Ramsey, Ben. “API First.” ZendCon. Santa Clara Convention Center, Santa Clara, CA. 10 Oct. 2013. Conference Presentation.
  57. Photo Credits 1. “Samsung to Launch Smart Feature Phone ‘REX

    Series’ in Emerging Markets” by Samsung Tomorrow, flickr.com/photos/samsungtomorrow/8475665954 2. “Danger D'Avalanche” by Peter Dutton, flickr.com/photos/joeshlabotnik/375149668 3. “Favela da Rocinha” by Scott Hadfield, flickr.com/photos/hadsie/3289716114 4. “Wrapping paper and bow” by Jonathan, flickr.com/photos/metabrilliant/4805163439