RESTMike Amundsen  @mamund
Preliminaries• Mike Amundsen• Developer, Architect, Presenter• Hypermedia Junkie• “I program the Internet”• Designing Hype...
And now for somethinga completely different…
Representational     State   Transfer
Representational     State   Transfer
REST is astyle
REST     is a    style      of  networkarchitecture.
HTTP   is aStandard
HTTP   is aStandardTransferProtocol
REST != HTTP
Well then, what IS REST?
Roy T. Fielding, 2000
“REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication   while a...
“REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication   while a...
“REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication   while a...
“REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication   while a...
Srsly?
But some people say…
REST IS…•   Crafting URIs•   Identifying Resources•   Designing Responses (JSON, XML, etc.)•   HTTP Verbs (GET, PUT, POST,...
REST IS…•   Crafting URIs•   Identifying Resources•   Designing Responses (JSON, XML, etc.)•   HTTP Verbs (GET, PUT, POST,...
Actually…
REST IS NOT…•   Crafting URIs•   Identifying Resources•   Designing Responses (JSON, XML, etc.)•   HTTP Verbs (GET, PUT, P...
But really, what is REST?
A set of constraints.
Client-Server                Not Peer-to-Peer
Stateless       No Server-Side Session
Cache   Don’t hit server every time
Uniform Interface           Same API for everyone
Layered System         Add hardware any time
Code On Demand *Don’t hard-code clients, send code to them.
"I have never been   forced to acceptcompromises but I have  willingly accepted     constraints."               Charles Ea...
Why constraints?
Isthereanythingmoreintimidating…?
Wait, that’s it?
Well…
"[REST] is achieved by   placing constraints onconnector semantics where other styles have focused on component semantics....
"[REST] is achieved by   placing constraints onconnector semantics where other styles have focused on component semantics....
"[REST] is achieved by   placing constraints onconnector semantics where other styles have focused on component semantics....
Connector != Component
Component•   Database•   File System•   Message Queue•   Transaction Manager•   Source Code
Component == Private
Connector•   Web Server•   Browser Agent•   Proxy Server•   Shared Cache
Connector == Public
Client                Server         Connectors          The Web         Components
And the best way to      ensure   Connectorswork together is…
Uniform Interface1.   Identification of Resources2.   Resource Representations3.   Self-Descriptive Messages4.   Hypermedia
Uniform Interface1.   Identification of Resources (URIs)2.   Resource Representations3.   Self-Descriptive Messages4.   Hy...
Uniform Interface1.   Identification of Resources (URIs)2.   Resource Representations (Media-Types)3.   Self-Descriptive M...
Uniform Interface1.   Identification of Resources (URIs)2.   Resource Representations (Media-Types)3.   Self-Descriptive M...
Uniform Interface1.   Identification of Resources (URIs)2.   Resource Representations (Media-Types)3.   Self-Descriptive M...
Seems kinda complicated…
REST in one slide       Read the dissertation, really!
Component   Connector   Connector   Component    Client                              Server                    Conne...
“Those of us who have been trainedas architects have this desire perhaps at the very center of our lives: that  one day, s...
RESTMike Amundsen  @mamund
REST-something-different (2011-05-12)
REST-something-different (2011-05-12)
REST-something-different (2011-05-12)
REST-something-different (2011-05-12)
REST-something-different (2011-05-12)
REST-something-different (2011-05-12)
Upcoming SlideShare
Loading in …5
×

REST-something-different (2011-05-12)

641 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
641
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

REST-something-different (2011-05-12)

  1. 1. RESTMike Amundsen @mamund
  2. 2. Preliminaries• Mike Amundsen• Developer, Architect, Presenter• Hypermedia Junkie• “I program the Internet”• Designing Hypermedia APIs with Node and HTML5 O’Reilly, Fall 2011
  3. 3. And now for somethinga completely different…
  4. 4. Representational State Transfer
  5. 5. Representational State Transfer
  6. 6. REST is astyle
  7. 7. REST is a style of networkarchitecture.
  8. 8. HTTP is aStandard
  9. 9. HTTP is aStandardTransferProtocol
  10. 10. REST != HTTP
  11. 11. Well then, what IS REST?
  12. 12. Roy T. Fielding, 2000
  13. 13. “REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication while at the same timemaximizing the independenceand scalability of component implementations.” Roy T. Fielding, 2000
  14. 14. “REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication while at the same timemaximizing the independenceand scalability of component implementations.” Roy T. Fielding, 2000
  15. 15. “REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication while at the same timemaximizing the independenceand scalability of component implementations.” Roy T. Fielding, 2000
  16. 16. “REST is a coordinated set ofarchitectural constraints thatattempts to minimize latencyand network communication while at the same timemaximizing the independenceand scalability of component implementations.” Roy T. Fielding, 2000
  17. 17. Srsly?
  18. 18. But some people say…
  19. 19. REST IS…• Crafting URIs• Identifying Resources• Designing Responses (JSON, XML, etc.)• HTTP Verbs (GET, PUT, POST, DELETE)• Headers (Caching, etc.)• HTTP Response Codes (200, 404, 418, etc.)
  20. 20. REST IS…• Crafting URIs• Identifying Resources• Designing Responses (JSON, XML, etc.)• HTTP Verbs (GET, PUT, POST, DELETE)• Headers (Caching, etc.)• HTTP Response Codes (200, 404, 418, etc.)
  21. 21. Actually…
  22. 22. REST IS NOT…• Crafting URIs• Identifying Resources• Designing Responses (JSON, XML, etc.)• HTTP Verbs (GET, PUT, POST, DELETE)• Headers (Caching, etc.)• HTTP Response Codes (200, 404, 418, etc.)
  23. 23. But really, what is REST?
  24. 24. A set of constraints.
  25. 25. Client-Server Not Peer-to-Peer
  26. 26. Stateless No Server-Side Session
  27. 27. Cache Don’t hit server every time
  28. 28. Uniform Interface Same API for everyone
  29. 29. Layered System Add hardware any time
  30. 30. Code On Demand *Don’t hard-code clients, send code to them.
  31. 31. "I have never been forced to acceptcompromises but I have willingly accepted constraints." Charles Eames, Eames Design, 1989
  32. 32. Why constraints?
  33. 33. Isthereanythingmoreintimidating…?
  34. 34. Wait, that’s it?
  35. 35. Well…
  36. 36. "[REST] is achieved by placing constraints onconnector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000
  37. 37. "[REST] is achieved by placing constraints onconnector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000
  38. 38. "[REST] is achieved by placing constraints onconnector semantics where other styles have focused on component semantics." Roy T. Fielding, 2000
  39. 39. Connector != Component
  40. 40. Component• Database• File System• Message Queue• Transaction Manager• Source Code
  41. 41. Component == Private
  42. 42. Connector• Web Server• Browser Agent• Proxy Server• Shared Cache
  43. 43. Connector == Public
  44. 44. Client Server Connectors The Web Components
  45. 45. And the best way to ensure Connectorswork together is…
  46. 46. Uniform Interface1. Identification of Resources2. Resource Representations3. Self-Descriptive Messages4. Hypermedia
  47. 47. Uniform Interface1. Identification of Resources (URIs)2. Resource Representations3. Self-Descriptive Messages4. Hypermedia
  48. 48. Uniform Interface1. Identification of Resources (URIs)2. Resource Representations (Media-Types)3. Self-Descriptive Messages4. Hypermedia
  49. 49. Uniform Interface1. Identification of Resources (URIs)2. Resource Representations (Media-Types)3. Self-Descriptive Messages (Header+Body)4. Hypermedia
  50. 50. Uniform Interface1. Identification of Resources (URIs)2. Resource Representations (Media-Types)3. Self-Descriptive Messages (Header+Body)4. Hypermedia (Links & Forms)
  51. 51. Seems kinda complicated…
  52. 52. REST in one slide Read the dissertation, really!
  53. 53. Component   Connector   Connector   Component Client Server Connectors The Web Components
  54. 54. “Those of us who have been trainedas architects have this desire perhaps at the very center of our lives: that one day, somewhere, somehow, we shall build one building which iswonderful, beautiful, breathtaking, a place where people can walk and dream for centuries.” Christopher Alexander, The Timeless Way of Building - 1979
  55. 55. RESTMike Amundsen @mamund

×