Real World REST with Atom/AtomPub

3,362
-1

Published on

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,362
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
27
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Real World REST with Atom/AtomPub

  1. 1. Real World REST with Atom/AtomPub
  2. 2. What is REST? • set of design principles • widely implemented (the Web!) • a term coined by Roy Fielding for his doctoral dissertation
  3. 3. What is REST? • a useful set of best practices for building web apps • an “interface” for the web • simple (but not necessarily easy)
  4. 4. RESTful Apps • “play well” with others • are evolvable • are robust & maintainable • can be secure
  5. 5. What is Atom? • a simple XML format • very similar to RSS • useful for representing web content
  6. 6. What is AtomPub? • Atom Publishing Protocol • a standard for “writing” to the web • based on REST principles
  7. 7. Who is implementing Atom/AtomPub? • Google • Microsoft • IBM • LAITS :-)
  8. 8. REST principles • Everything is a Resource • Resources have Names • Simple operations (GET, PUT, POST, DELETE)
  9. 9. REST principles • Resources have Representations • Hypermedia is the Engine of Application State
  10. 10. REST principles in practice • Everything is a Resource • bookmarks • orders • employees • media files
  11. 11. REST principles in practice • Resources have Names • http://del.icio.us/pkeane/rest • http://.../orders/234 • http://.../employee/pkeane • http://.../funnycats.jpg
  12. 12. REST principles in practice • Simple operations • GET http://del.icio.us/pkeane • POST to http://.../orders • PUT http://.../employee/pkeane • DELETE http://.../funnycats.jpg
  13. 13. REST principles in practice • Resources have Representations <feed xmlns="http://www.w3.org/2005/Atom"> <title>Example Feed</title> <link href="http://example.org/"/> <updated>2003-12-13T18:30:02Z</updated> <author> <name>John Doe</name> </author> <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> <entry> [...] </entry>
  14. 14. REST principles in practice • Resources have Representations { "updated": "2008-06-24T20:38:12-05:00", "name": "search: Alfred Waud in american_west.artist", "items": [ { "media": { "thumbnail": "http://dase/media/american_west/thumbnail/00194933_100.jpg", "small": "http://dase/media/american_west/small/000194933_640.jpg”, "medium": "http:/dase/media/american_west/medium/000194933_800.jpg", "large": "http://dase/media/american_west/large/000194933_1024.jpg", }}] }
  15. 15. REST principles in practice • Resources have Representations <html> <head> <title>funny cat picturs</title> </head> <body> <h1>My Cat Ernie</h1> <img src=”http://flickr.com/pkeane/set/33/image/2.jpg”/> </body> </html>
  16. 16. REST principles in practice • Resources have Representations http://flickr.com/pkeane/set/33/image/2.jpg
  17. 17. REST principles in practice • Hypertext is the Engine of Application State
  18. 18. REST principles in practice • Hypertext is the Engine of Application State Huh?
  19. 19. REST principles in practice • Hypertext is the Engine of Application State The representation ITSELF gives you all of the information you need to perform more useful operations.
  20. 20. REST principles in practice • Hypertext is the Engine of Application State • Links: • <a href=”...”>news</a> • <img src=”cat.png”/> • <link type=”text/css” href=”style.css”/> • Forms: • <form action=”orders” method=”post”>....</form>
  21. 21. REST in DASe
  22. 22. RESTful Google Docs GET LAITS Google (Atom) Server POST (form) XHR (Atom) Browser
  23. 23. Why REST? • Developers have a better understanding of the benefits of HTTP & statelessness • AJAX has made HTTP cool • Django/Rails encourages good RESTful practices (Struts didn’t)
  24. 24. Why REST? • Mash-ups & Web 2.0 • Atom, JSON, XHTML • Cloud Computing / Distributed Systems
  25. 25. Topics/Ideas • loose coupling • “engineer for serendipity” • resources, not procedures • reuse
  26. 26. Topics/Ideas • functional programming at web-scale • declarative syntaxes • high value on good specs • mime-types
  27. 27. Topics/Ideas • decomposition • complex procedures can be modeled as document passing • simple/generic interfaces • UNIX philosophy
  28. 28. Resources • http://del.icio.us/pkeane/rest+fyi • http://dase.googlecode.com
  29. 29. Peter Keane, LAITS pkeane@mail.utexas.edu
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×