How to design good APIs

509 views

Published on

This is the presentation I did with my colleague Nuno Baptista for NextStep 2012

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
509
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

How to design good APIs

  1. 1. How to Design a Good API?2012-05-11www.outsystems.com Page 1 © 2012 OutSystems – all rights reserved
  2. 2. What is a Good API? Hard to Leads to misuse readable code Stable Easy to learn Complete and memorizewww.outsystems.com Page 2 © 2012 OutSystems – all rights reserved
  3. 3. What to consider?User Stories LoggingNaming VersioningGranularity ScalablilityError Handling Security www.outsystems.com Page 3 © 2012 OutSystems – all rights reserved
  4. 4. User Stories• Who will use the API?• How will they use it?• Where will they use it?• Put yourself in the developer’s shoes!Naming & Type• Meaningful & Readable• Consistent• Strongly typedwww.outsystems.com Page 4 © 2012 OutSystems – all rights reserved
  5. 5. Granularity GetOrderDetail() CalculateTotalAmount() GetEmployeeName() 3 x GetOrderLine()www.outsystems.com Page 5 © 2012 OutSystems – all rights reserved
  6. 6. Error Handlingwww.outsystems.com Page 6 © 2012 OutSystems – all rights reserved
  7. 7. Logging• Measure Usage• Performance Monitoring• Troubleshoot• Service Center helps you out! Versioning• Go public means you have to version• No usage = deprecate old version• It’s costly so avoid it!www.outsystems.com Page 7 © 2012 OutSystems – all rights reserved
  8. 8. Scalability• Use Partial Response – Pagination – Filtering• agileplatform™ already scales! Security• Control access to API for internal• HTTPS/SSL for Public APIs• Token-based Authenticationwww.outsystems.com Page 8 © 2012 OutSystems – all rights reserved
  9. 9. API is a Product!www.outsystems.com Page 9 © 2012 OutSystems – all rights reserved
  10. 10. Scenarioswww.outsystems.com Page 10 © 2012 OutSystems – all rights reserved
  11. 11. Master data Most companies want to centralize their master data. - Nouns and Verbs NamingApplicationsComposite Directory Performance - Read-only Entities Security Management -Throw Exception Error handlingCore Business Components - TrueChange™ Versioning Employees www.outsystems.com Page 11 © 2012 OutSystems – all rights reserved
  12. 12. Information Provider Airport management company provides real time flights’ information to their clients 3rd Parties - Lifetime Token Security - Custom Audit Logging agileplatform™ Flight - Partial Response Scalablility Services - API Document Documentation Airports Flights - New WebService Versioningwww.outsystems.com Page 12 © 2012 OutSystems – all rights reserved
  13. 13. 3-Tier Layer Bank company wants a CRM application with a SOA approach. Security is critical. - Int. Auth, Int. Net. Security UI Layer1 CRM HomeBank - Resource based User Stories Business Layer Account Customer - Cache Scalablility Services Services2 - OutDoc Documentation Accounts Customerswww.outsystems.com Page 13 © 2012 OutSystems – all rights reserved
  14. 14. Extranet Insurance company wants to scale out claim management through partners. Small Large Partners - Use reUse GranularityPartners - Return error Error Handling WebPortal - Application Log Loggingagileplatform™ Claim Services - HTTPS + S.Token Security Claim Managementwww.outsystems.com Page 14 © 2012 OutSystems – all rights reserved
  15. 15. What is a Good API? Hard to Leads to misuse readable code Stable Easy to learn Complete and memorizewww.outsystems.com Page 15 © 2012 OutSystems – all rights reserved
  16. 16. Steve Jobs
  17. 17. www.outsystems.com Page 17 © 2012 OutSystems – all rights reserved
  18. 18. andre.vieira@outsystems.com nuno.baptista@outsystems.comwww.outsystems.com Page 18 © 2012 OutSystems – all rights reserved

×