Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

API Design Anti-Patterns

2 546 vues

Publié le

Talk from the Auckland API and microservices meetup 10/20/15
http://www.meetup.com/Auckland-API-and-Microservices-Meetup/events/225828804/

Beyond specific anti-patterns, we also covered API design-first development process, and how to utilize spec formats and feedback loops to produce higher quality APIs.

Publié dans : Logiciels
  • I have always found it hard to meet the requirements of being a student. Ever since my years of high school, I really have no idea what professors are looking for to give good grades. After some google searching, I found this service ⇒ www.HelpWriting.net ⇐ who helped me write my research paper.
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • If you’re struggling with your assignments like me, check out ⇒ www.WritePaper.info ⇐. My friend sent me a link to to tis site. This awesome company. After I was continuously complaining to my family and friends about the ordeals of student life. They wrote my entire research paper for me, and it turned out brilliantly. I highly recommend this service to anyone in my shoes. ⇒ www.WritePaper.info ⇐.
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THE BOOK INTO AVAILABLE FORMAT (New Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THE can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THE is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBOOK .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, CookBOOK, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, EBOOK, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THE Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THE the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THE Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • Before I came across this program, my confidence was a little low. Having achieved a 'C' grade in a GCSE mock exam just prior to it, I wasn't sure how I was going to better this. However, thanks to Jeevan's program, I was able to see how I could maximise my grade in a maths exam. At the end of the day, this is the most important thing � the result on the paper! After a month of following Jeevan's program, I achieved a strong 'B' grade (a couple of marks off an A) in my next GCSE mock exam. I achieved the highest grade in my entire year group and I am now being considered to take my GCSE maths exam in November this year, where I would have just begun year 11. My teacher was surprised; how did I make such a big improvement in maths in such a short space of time?!▲▲▲ https://bit.ly/33W8jmf
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

API Design Anti-Patterns

  1. 1. API DESIGN ANTI- PATTERNS Jason Harmon API Design @PayPal @Braintree @jharmn
  2. 2. JASON HARMON • From Austin, TX • Head of API Design at PayPal • Moving into Braintree • Blogger at apiux.com, pragmaticapi.com • Organizer austinapi.com meetup • Youtube: API Workshop • https://www.youtube.com/ch annel/UCKK2ir0jqCvfB- kzBGka_Lg
  3. 3. COLLECTOR OF MISTAKESJob #1 in creating consistent DX
  4. 4. MIXED UP CONVENTION S Path, query parameters, headers, fields resourceName resource-name resource_name PICK ONE, BE CONSISTENT!
  5. 5. PARAMETER CONFUSIONPath, Query, Body, Header?
  6. 6. • A few rules of thumb: • Path: required, resource-identifier • Query: optional, query collections • Body: resource-specific/logic • Header: global/platform-wide API PARAMETERS
  7. 7. JSON JUNK DRAWER https://www.youtube.com/watch?v=- MBXsmSrKE8 REST API Design: Avoid future proofing with the JSON junk drawer
  8. 8. JSON JUNK DRAWER TL;DR Useful for client-defined fields/values Not a good way to extend your API Just add fields to resposne Don’t add new required fields to request s
  9. 9. SEQUENTIAL IDENTIFIERS /invoices/8765432 Usually derived from database sequences +1 each time a resource is created
  10. 10. • https://www.owasp.org/index.php/Top_10_20 10-A4-Insecure_Direct_Object_References • Developers suck at securing resources • Better to use non-sequential strings for resource IDs • UUID/GUID is an obvious option INSECURE DIRECT OBJECT REFERENCE
  11. 11. IDENTITY IN URLS /license?user=BR548076 /license?token=E43FD312 /users/T22000129/license
  12. 12. HTTP DEFINES AUTH http://tools.ietf.org/html/rfc7235#section-4.2 Use the Authorization header + token
  13. 13. DON’T FORGET THE LOGSMost web servers/proxies/intermediaries log: Verb + URL, not often query, rarely headers
  14. 14. RELAX. These are pretty easy fixes, if it’s not live yet (or v2). Plus, there’s a bright future.
  15. 15. DESIGN FIRST There’s really not a reasonable debate
  16. 16. A DESIGN REMEDIAL Thinking developer experience
  17. 17. DESIGN THINKING: RULESAPIs are for humans and machines Innovate The human rule • All design activity is ultimately social in nature The ambiguity rule • Design thinkers must preserve ambiguity The re-design rule • All design is re-design The tangibility rule • Making ideas tangible always facilitates communication
  18. 18. DESIGN THINKING: TOOLS • Understanding your audiences thoughts, desires, beliefs and actions • Co-creating outcomes with that audience • Creating early versions or prototypes and testing for fit / relevance / acceptability • Root cause analysis, five whys, mindmapping
  19. 19. AUTOMATE Spec-driven development
  20. 20. DESIGN Collaborate on new design in API spec
  21. 21. GOVERNANCE Validate design against API standards
  22. 22. CREATE STANDARDS Make the rules, and stick to them
  23. 23. STANDARDS Some of the primary concerns • Authentication/Authorizat ion • Versioning • Naming conventions for URLs, parameters, headers • Interaction patterns with verbs • Paging/sorting • Hypermedia semantics
  24. 24. SHARE STANDARDS! If we all share, broad consistency can exist PayPal API Style Guide https://devblog.paypal.com/paypals-api-style-guide/
  25. 25. DISCOVER Render specs in developer portal Indicate planned APIs vs live
  26. 26. VISUALIZE SPECS Many open source options • Swagger-UI • RAML API Portal • Apiary • Numerous options on Github • Host it and make it known Hosted services • Example: http://gelato.io
  27. 27. MOCK Use mock APIs from specs to get feedback Samples are a great starting point Image credit: https://www.flickr.com/photos/timthetrumpetguy/160813983 70
  28. 28. MOCK Fake it ‘til you make it Again, many open source options • Swagger, RAML, Blueprint all have Github projects Custom-build • Define controllers • Link responses to samples Host • Make URLs available to clients for feedback
  29. 29. DEVELOP Build APIs according to specs Validate request/response in app from spec
  30. 30. DEVELOP/VALIDATE Validate request/response against spec in acceptance tests • Emerging area in open source Validate request in API against spec • Also, emerging area in some languages • Potentially processable in proxy/facade layer
  31. 31. VALIDATE DESIGN Check request/response vs spec in acceptance tests BDD FTW
  32. 32. ACCEPTANCE TESTING API acceptance testing means HTTP clients • Not to say you shouldn’t do unit testing Define english-readable acceptance criteria • BDD approaches work remarkably well • Chakram JS is a great way to start Ensure visibility • Integrate into CI • Test failures should indicate what’s wrong to anyone • Product should only accept stories when tests are green
  33. 33. GO LIVE! Be sure to integrate validation with CI
  34. 34. WORKS AS DESIGNED You can still always screw up, so be smart
  35. 35. Jason Harmon API Design @PayPal @Braintree @jharmn

×