The API Facade Pattern: Common Patterns - Episode 2
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

The API Facade Pattern: Common Patterns - Episode 2

on

  • 9,594 views

Whether you are starting from a green field or brown, in this webinar we'll share common patterns of facades that will help you get your API initiative off the ground. ...

Whether you are starting from a green field or brown, in this webinar we'll share common patterns of facades that will help you get your API initiative off the ground.
- Data format mediation
- URL design
- Authorization and versioning

Statistics

Views

Total Views
9,594
Views on SlideShare
3,457
Embed Views
6,137

Actions

Likes
4
Downloads
122
Comments
0

15 Embeds 6,137

http://blog.apigee.com 5760
http://apigee.com 204
https://blog.apigee.com 66
http://play.daumcorp.com 53
http://feeds.apigee.com 26
http://mktg-dev.apigee.com 9
http://blog.sonoasystems.com 5
http://blog-dev.apigee.com 4
http://blog.edit.apigee.net 3
http://mktg-new.local 2
http://translate.googleusercontent.com 1
http://mktg-dev.wearepropeople.md 1
http://ranksit.com 1
http://ip54.216-86-157.static.steadfast.net 1
http://webcache.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Creative Commons Attribution-Share Alike 3.0 United States License

The API Facade Pattern: Common Patterns - Episode 2 Presentation Transcript

  • 1. API Façade: Common PatternsEpisode 2Webinar ShortsMarch 2012 SeriesBrian Mulloy Apigee@landlessness @apigee
  • 2. groups.google.com/group/api-craft
  • 3. youtube.com/apigee
  • 4. New! IRC Channel #api-craft on freenode
  • 5. Webinar Shorts - March 2012 New!Episode 1The API Facade: OverviewTuesday, March 6thEpisode 2The API Facade: Common PatternsTuesday, March 13thEpisode 3The API Facade: TechnologyTuesday, March 20thEpisode 4The API Facade: PeopleTuesday, March 27th
  • 6. Episode 2 Topics• Recap: API façade• Errors• Stubs• URLs• Versioning• Data formats• Internal & external systems
  • 7. Recap: API Façade
  • 8. App App Developer API Facade Content Big DB Management JDBC RSS SOAPSystem
  • 9. One Big Problem 1. Build up from systems of record App XML XML XML XML XML XML1. Objects Tables RSS RSS Tables RSS Content Big DB Management JDBC RSS SOAP System
  • 10. Three Small Problems 1. Design the Ideal API 2. Implement Design with Stubs as Façade App 3. Mediate between Façade and Systems Developer1. Ideal Design2. API Facade3. Mediate Content Big DB Management JDBC RSS SOAP System
  • 11. Common patterns
  • 12. Errors
  • 13. When I say errors, you say test-driven development.
  • 14. Errors 200 201 304 400 401 403 404 500{“developerMessage”:“Verbose, plain language descriptionof the problem for the app developer with hints about howto fix it.”,“userMessage”:“Pass this message on to the appuser, if needed.”,"errorCode":12345, ”status":401,“moreInfo”:“http://dev.teachdogrest.com/errors/12345”} Request Response API Facade nothing to see here
  • 15. Errors GET /products?raise=500 (don’t support raise in production)Request Response API Facade nothing to see here
  • 16. ErrorsRequest Response 404 Not Found API Facade 449 Retry With Big System
  • 17. Stubs
  • 18. Stubs{"products”: [{"product":{"id":"1234”,"name":"Widget”, "color":"white"}},{"product":{"id":"1235”, "name":"Gadget”, "color":"brown"}} ]} Request Response API Facade nothing to see here
  • 19. Stubs GET /products?mock=true (don’t support mock in production)Request Response API Facade nothing to see here
  • 20. URLs
  • 21. URLs App Developer/v2/accounts
  • 22. URLs/services/data/v20.0/sobjects/Account Big System
  • 23. URLs /v2/accounts Request Response API Facade/services/data/v20.0/sobjects/Account Big System
  • 24. Support Limited ClientsGET /v2/accounts/123?method=delete Request Response API FacadeDELETE /services/data/v20.0/sobjects/Account/123 Big System
  • 25. Versioning
  • 26. Versioning Fast App Slow App Developer Developer/v3/accounts /v2/accounts
  • 27. Versioning GET /v2/accounts GET /v3/accounts Request API FacadeGET old.internal.com/accounts GET new.internal.com/accounts Big Old New Untried System System
  • 28. Data Formats
  • 29. Data FormatsHTML5 App Java AppDeveloper Developer JSON SOAP
  • 30. Data Formats POST /v2/accounts.xml SOAP Request Response API Facade/services/data/v20.0/sobjects/Account SOAP SOAP
  • 31. Data Formats GET /v2/accounts.json JSON Request Response API Facade/services/data/v20.0/sobjects/Account SOAP SOAP
  • 32. Internal & external systems
  • 33. Internal API Facade ContentDB Management SOAP JDBC
  • 34. External API FacadeSOAP XML JSON RSS
  • 35. Q&A
  • 36. Q&AShould the version number appear in the URL immediatelyafter the domain name or is it better to have application nameafter domain name? Billing accounts /accounts/v2/create?
  • 37. Q&AWith all the shunting you suggest make for a terrible complexlayer?
  • 38. Q&AWhat would you recommend for a URL pattern for a sandboxinstance?
  • 39. Q&AHow can a GET request be transformed to a SOAP POST,specifically when the SOAP POST request size is huge?
  • 40. Q&AWhat about version in the request header instead of putting itin the URL, what would the drawback be of using it in therequest header?
  • 41. Q&AShould every response follow a standard format that containserrors, if any, along with response body or should the responsebody change based on success or failure of the operation?
  • 42. Q&AWhat is the functional difference between the raise and themock parameters again?
  • 43. Q&AFor the API I am hosting façade pattern makes sense, but forthe external systems where I am consuming APIs, factory seemsmore appropriate. What’s your take?
  • 44. Q&AWhat are your thoughts on REST sitemaps, worth it?
  • 45. Q&AGet flash accounts should return all accounts right? Wouldn’twant to prevent this, what would a URL request look like? Ifyou’re reflecting a response from the database where thestate=Washington, how would that work?
  • 46. THANK YOUSubscribe to API webinars at:youtube.com/apigee
  • 47. THANK YOUIRC#api-crafton freenode
  • 48. THANK YOUQuestions and ideas to:groups.google.com/group/api-craft
  • 49. THANK YOUContact me at:@landlessnessbrian@apigee.com