Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Hypermedia

3,319 views

Published on

My Hypermedia and ASP.NET Web API talk from Oredev

RestBugs sample (for of Howard Dierking's repo) using templates: https://github.com/glennblock/RestBugs

Collection+Json: https://github.com/glennblock/collectionjson

  • Be the first to comment

Hypermedia

  1. 1. Hypermedia andASP.NET Web API Glenn Block @gblock
  2. 2. Hypermedia 101
  3. 3. What is Hypermedia? iou s Prev Catalog Embedded links in HTTP Ne xtresponses which are application state transitions
  4. 4. What is Hypermedia? Embedded links in HTTPresponses which are application state transitions
  5. 5. What is Hypermedia? Embedded links in HTTPresponses which are application state transitions
  6. 6. What is o va l pr Hypermedia? A p Fulfillment Order Embedded links in HTTP Ca ncresponses which are application el lat io n state transitions
  7. 7. What isHypermedia? Not a new concept
  8. 8. What isHypermedia? Not a new concept
  9. 9. What isHypermedia? Not a new concept
  10. 10. What isHypermedia? Not a new concept
  11. 11. What isHypermedia? Not a new concept
  12. 12. What isHypermedia? Not a new concept
  13. 13. What is aHypermedia API API A web API that returns responses containing hypermedia
  14. 14. What is aHypermedia API Not this
  15. 15. What is aHypermedia API This is better
  16. 16. What is aHypermedia API And this is really good
  17. 17. How does ahypermedia work? API Server embeds links to resources
  18. 18. How does a hypermedia work? ClientClients identifies available links and their associated urls
  19. 19. How does ahypermedia work? ClientClient navigates to the chosen link
  20. 20. HypermediaThe concept is simple
  21. 21. Hypermedia and Web APIHow do we implement it?
  22. 22. COLLECTION +JSON HTML HAL ATOM Media TypesHypermedia is conventionallysurfaced via the media type SIREN Hypermedia can also be surfaced via headers
  23. 23. Formatters and Media Type Hypermedia Formatter Media Type APIFormatters create media type Formatter Controller representations from objects Media Type Formatters are the key place Formatterfor hypermedia to be rendered
  24. 24. Controller Media Type populates a model with links Models Media Type API One approach is to have a Formatter Controller media type specific model Formatter renders theThe application populates the model and linksmodel, and a custom formatter renders it
  25. 25. Controller Media Type returns a set of DTOs Templates Media Type APIAnother is to have media type Formatter Controller specific templates. FormatterThe application returns a model renders template with links passed to a formatter.The formatter renders using a a template (like razor)
  26. 26. Rest Agent Client
  27. 27. More informationhttp://codebetter.com/glennblockhttp://amundsen.com/media-types/collection/http://github.com/howarddierking/restbugshttp://github.com/tavis-software/RestAgent

×