Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Power of a Great API Damian Brady

Similar presentations


Presentation on theme: "The Power of a Great API Damian Brady"— Presentation transcript:

1

2 The Power of a Great API Damian Brady
Microsoft Ignite 2015 2/19/2019 8:28 AM The Power of a Great API The case for writing API-first applications Damian Brady ARC341B © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 Why is an API a good thing? Implementation Demo
Microsoft Ignite 2015 2/19/2019 8:28 AM Why is an API a good thing? Implementation Demo © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 I need one button to disable all the machines in an environment
❄️

5 Solution One “Sorry, you’re going to have to do it 200 times”
Microsoft Ignite 2015 2/19/2019 8:28 AM Solution One “Sorry, you’re going to have to do it 200 times” © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Solution Two “Sure! We’ll add that!” Microsoft Ignite 2015
2/19/2019 8:28 AM Solution Two “Sure! We’ll add that!” © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Solution Three “Here’s a script”

8 API Microsoft Ignite 2015 2/19/2019 8:28 AM
© 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9

10 UNTAPPD

11

12 API != Public API

13 Implementation

14 UI Business Data Exceptions Microsoft Ignite 2015 2/19/2019 8:28 AM
© 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 API First Focus on your function Make your UI use your API UI API
Business Data

16 API Second? Expose your Business layer Refactor or add a layer
UI Expose your Business layer Refactor or add a layer Make your UI use your API API Data Business

17 Exposing your API There are plenty of options… but HTTP is easy
Self-hosted endpoints – OWIN, Nancy, ASP.NET 5 PM> Install-Package Microsoft.Owin.SelfHost PM> Install-Package Nancy.Owin

18 Types of Web APIs HTTP/RPC REST HATEOAS Remote Procedure Call
Method calls over HTTP Request-response REST REpresentational State Transfer Resource-based URIs HTTP Verbs Stateless HATEOAS Hypermedia As The Engine Of Application State REST + links Self-describing

19 HTTP/RPC

20 REST

21 HATEOAS /emojis

22 Be pragmatic

23 What to include? CRUD for Resources + Sensible functions Be pragmatic
POST, GET, PUT, DELETE /api/customers/1 /api/customers/1/addresses /api/customers/1?includeDetail=true /api/customers/1?detailLevel=2 Be pragmatic Use separate classes

24 Other options OData? GraphQL?
/api/Customers(1)/Orders?$filter='Total gt 10000'&$take=5&$orderby=Total,Date desc GraphQL?

25 Other things that might hurt
Long-running Tasks Security Versioning Caching Content negotiation

26 Architecture The Principle of Least Surprise The Pit of Success Be conservative in what you send, liberal in what you accept

27 Architecture Consistent URIs /api/customers/1 /api/order/1
/api/customers?top=5 /api/orders/top?count=5

28 Architecture Consistent objects /api/customers/1 /api/customers

29 Let’s make one

30 Why is an API a good thing? Implementation Demo
Microsoft Ignite 2015 2/19/2019 8:28 AM Why is an API a good thing? Implementation Demo © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

31 Thankyou Damian Brady Octopus Deploy @damovisa | @octopusdeploy

32 Complete your session evaluation on My Ignite for your chance to win one of many daily prizes.

33 Continue your Ignite learning path
Microsoft Ignite 2015 2/19/2019 8:28 AM Continue your Ignite learning path Visit Microsoft Virtual Academy for free online training visit Visit Channel 9 to access a wide range of Microsoft training and event recordings Head to the TechNet Eval Centre to download trials of the latest Microsoft products © 2015 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

34


Download ppt "The Power of a Great API Damian Brady"

Similar presentations


Ads by Google