Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DDD & Hypermedia

DDD & Hypermedia

More Decks by API Strategy & Practice Conference

Other Decks in Technology

Transcript

  1. © 2014 SpringOne 2GX. All rights reserved. Do not distribute

    without permission. DDD & HYPERMEDIA @olivergierke
  2. "Code generation – so that you can do the wrong

    thing faster… Kevlin Henney
  3. Method URI Action Step POST /orders Create new order 1

    POST/PATCH /orders/{id} Update the order (only if "payment expected") 2 DELETE /orders/{id} Cancel order (only if "payment expected") 3 PUT /orders/{id}/payment Pay order 4 Barista preparing the order GET /orders/{id} Poll order state 5 GET /orders/{id}/receipt Access receipt DELETE /orders/{id}/receipt Conclude the order process 6
  4. " What needs to be done to make the REST

    architectural style clear on the notion that hypertext is a constraint? In other words, if the engine of application state (and hence the API) is not being driven by hypertext, then it cannot be RESTful and cannot be a REST API. Period. Is there some broken manual somewhere that needs to be fixed? – Roy Fielding
  5. Method URI Action Step POST /orders Create new order 1

    POST/PATCH /orders/{id} Update the order (only if "payment expected") 2 DELETE /orders/{id} Cancel order (only if "payment expected") 3 PUT /orders/{id}/payment Pay order 4 Barista preparing the order GET /orders/{id} Poll order state 5 GET /orders/{id}/receipt Access receipt DELETE /orders/{id}/receipt Conclude the order process 6
  6. Method Resource type Action Step POST orders Create new order

    1 POST/PATCH update Update the order 2 DELETE cancel Cancel order 3 PUT payment Pay order 4 Barista preparing the order GET order Poll order state 5 GET receipt Access receipt DELETE receipt Conclude the order process 6
  7. Resources • Jean-Jacques Dubray – 
 Understanding the cost of

    versioning an API - Blog • Domain Driven Design Quickly - Ebook • Spring RESTBucks - Github repository • Spring RESTDocs - Github repository • Andy Wilkinson – Documenting RESTful APIs - Webinar recording