Road to REST


Published on

Video and slides synchronized, mp3 and slide download available at

Rickard Oberg explains how to expose use-cases to solve the linking problem in RESTful APIs, and how this will simplify both API development, documentation, as well as client development. Filmed at

Rickard Oberg has worked on several OpenSource projects that involve J2EE development, such as JBoss, XDoclet and WebWork. He has also been Principal Architect of the SiteVision CMS/portal platform, where he used AOP as the foundation. Now he works for Neo Technology, building the leading graph database Neo4j. Twitter: @rickardoberg

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Road to REST

  1. 1. One link at a timeRickard Öberg, Neo TechnologyQCon code: 7817The Road to REST
  2. 2. News & Community Site• 750,000 unique visitors/month• Published in 4 languages (English, Chinese, Japanese and BrazilianPortuguese)• Post content from our QCon conferences• News 15-20 / week• Articles 3-4 / week• Presentations (videos) 12-15 / week• Interviews 2-3 / week• Books 1 / monthWatch the video with slidesynchronization on!
  3. 3. Presented at QCon Londonwww.qconlondon.comPurpose of QCon- to empower software development by facilitating the spread ofknowledge and innovationStrategy- practitioner-driven conference designed for YOU: influencers ofchange and innovation in your teams- speakers and topics driving the evolution and innovation- connecting and catalyzing the influencers and innovatorsHighlights- attended by more than 12,000 delegates since 2007- held in 9 cities worldwide
  4. 4. How it all began
  5. 5. The Mission
  6. 6. A fork in the roadRMI?SOAP?REST?
  7. 7. Exploring
  8. 8. Richardson Maturity modelLevel 0SOAP, XML RPC, POX – Single URILevel 1URI Tunnelling – Many URIs, Single verbLevel 2Many URIs, many verbsCRUD services (e.g. Amazon S3)Level 3Level 2 + Hypermedia – RESTful Services
  9. 9. REST to the rescue!“Representational State Transfer (REST)is a style of software architecture fordistributed hypermedia systems such asthe World Wide Web”
  10. 10. GuidelinesClient–serverStatelessCacheableLayered systemUniform interface
  11. 11. More guidelinesIdentification of resourcesManipulation of resources throughthese representationsSelf-descriptive messagesHypermedia As The Engine OfApplication State (HATEOAS)
  12. 12. The narrow road
  13. 13. What shall we expose?ClientServerData
  14. 14. What shall we expose?ClientServerDomain model
  15. 15. How?Servlets?JAX-RS?
  16. 16. What the...?/users/rickard/changepassword/users/rickard/resetpassword
  17. 17. Where is HATEOAS?!?“The next control state of an application residesin the representation of the first requestedresource, … The application state is controlled andstored by the user agent … anticipate changes tothat state (e.g., link maps and prefetching ofrepresentations) … The model application istherefore an engine that moves from one state tothe next by examining and choosing fromamong the alternative state transitions in thecurrent set of representations.” - Roy Fielding
  18. 18. What now?!?
  19. 19. One step at a time
  20. 20. What shall we expose?ClientServerUse cases
  21. 21. From the user perspective/account/changepassword/administration/server/users/rickard/resetpassword
  22. 22. Who can do what?/workspace/cases/<123>//administrator/.../overview/...
  23. 23. Follow the named linkREST APILinks LinkQuery Command
  24. 24. Application flowGET ..../indexGET <link with rel="possiblelabels">addlabel?id=1234, rel=addlabel,"Urgent!"POST the link
  25. 25. Link checkingWhat can the user do? Check for links!
  26. 26. Wohoo!
  27. 27. VersioningHATEOAS helpsExposing use cases helpsSend headerEx. X-STREAMFLOW-API: 1.2Client libraries
  28. 28. PerformanceExposing use cases really helpsUse e.g. GQL for table queriesClient decides columns and filteringfrom fixed set
  29. 29. TL;DLA Good REST API is like an uglywebsiteRESTful clients should follow linksand submit forms
  30. 30. Q &