SlideShare a Scribd company logo
1 of 29
Download to read offline
Real World REST
 with Atom/AtomPub
What is REST?
• set of design principles
• widely implemented (the Web!)
• a term coined by Roy Fielding
 for his doctoral dissertation
What is REST?
• a useful set of best practices for
  building web apps

• an “interface” for the web
• simple (but not necessarily easy)
RESTful Apps
• “play well” with others
• are evolvable
• are robust & maintainable
• can be secure
What is Atom?

• a simple XML format
• very similar to RSS
• useful for representing web content
What is AtomPub?

• Atom Publishing Protocol
• a standard for “writing” to the web
• based on REST principles
Who is implementing
 Atom/AtomPub?
      • Google
      • Microsoft
      • IBM
      • LAITS :-)
REST principles

• Everything is a Resource
• Resources have Names
• Simple operations (GET, PUT, POST,
  DELETE)
REST principles

• Resources have Representations
• Hypermedia is the Engine of
 Application State
REST principles in
       practice

• Everything is a Resource
   • bookmarks
   • orders
   • employees
   • media files
REST principles in
        practice

• Resources have Names
   • http://del.icio.us/pkeane/rest
   • http://.../orders/234
   • http://.../employee/pkeane
   • http://.../funnycats.jpg
REST principles in
        practice

• Simple operations
   • GET http://del.icio.us/pkeane
   • POST to http://.../orders
   • PUT http://.../employee/pkeane
   • DELETE http://.../funnycats.jpg
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>
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",
        }}]
}
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>
REST principles in
       practice
• Resources have Representations
   http://flickr.com/pkeane/set/33/image/2.jpg
REST principles in
        practice
• Hypertext is the Engine of
  Application State
REST principles in
        practice
• Hypertext is the Engine of
  Application State


             Huh?
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.
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>
REST in DASe
RESTful Google Docs
                  GET         LAITS
  Google         (Atom)       Server

 POST (form)
                          XHR (Atom)
               Browser
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)
Why REST?

• Mash-ups & Web 2.0
• Atom, JSON, XHTML
• Cloud Computing / Distributed
 Systems
Topics/Ideas

• loose coupling
• “engineer for serendipity”
• resources, not procedures
• reuse
Topics/Ideas

• functional programming at
 web-scale

• declarative syntaxes
• high value on good specs
• mime-types
Topics/Ideas

• decomposition
• complex procedures can be
 modeled as document passing

• simple/generic interfaces
• UNIX philosophy
Resources

• http://del.icio.us/pkeane/rest+fyi
• http://dase.googlecode.com
Peter Keane, LAITS
pkeane@mail.utexas.edu

More Related Content

What's hot

04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframeworkErhwen Kuo
 
Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Luca Zacchetti
 
What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer ScienceTaylor Lovett
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkMarcel Chastain
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalrErhwen Kuo
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web ServicesGreg Hines
 
Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIsSilota Inc.
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearchErhwen Kuo
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLITaylor Lovett
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitCraig Dickson
 
Drupal Security Intro
Drupal Security IntroDrupal Security Intro
Drupal Security IntroCash Williams
 
Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerRoald Umandal
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIsmdawaffe
 
Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearchbart-sk
 
Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security rightGábor Hojtsy
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + djangoNina Zakharenko
 
Doing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonDoing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonGábor Hojtsy
 

What's hot (20)

04 integrate entityframework
04 integrate entityframework04 integrate entityframework
04 integrate entityframework
 
Django Rest Framework - tips & trick
Django Rest Framework - tips & trick Django Rest Framework - tips & trick
Django Rest Framework - tips & trick
 
Why Django
Why DjangoWhy Django
Why Django
 
What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer Science
 
REST Easy with Django-Rest-Framework
REST Easy with Django-Rest-FrameworkREST Easy with Django-Rest-Framework
REST Easy with Django-Rest-Framework
 
03 integrate webapisignalr
03 integrate webapisignalr03 integrate webapisignalr
03 integrate webapisignalr
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIs
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearch
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
 
Drupal Security Intro
Drupal Security IntroDrupal Security Intro
Drupal Security Intro
 
Drupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + DockerDrupal 8 + Elasticsearch + Docker
Drupal 8 + Elasticsearch + Docker
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Secure your site
Secure your siteSecure your site
Secure your site
 
Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
 
Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security right
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
03 managing relationships
03   managing relationships03   managing relationships
03 managing relationships
 
Doing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonDoing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon London
 

Similar to Real World REST with Atom/AtomPub

Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Lucidworks
 
Django Overview
Django OverviewDjango Overview
Django OverviewBrian Tol
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practicehamnis
 
Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standardsJustin Avery
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsLiam Cleary [MVP]
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Oleksiy Panchenko
 
ERRest: the Basics
ERRest: the BasicsERRest: the Basics
ERRest: the BasicsWO Community
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologiesjrodbx
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with SolrErik Hatcher
 
REST Api Tips and Tricks
REST Api Tips and TricksREST Api Tips and Tricks
REST Api Tips and TricksMaksym Bruner
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with SolrErik Hatcher
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bagstuplum
 
Share point development 101
Share point development 101Share point development 101
Share point development 101Becky Bertram
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceAdam Norwood
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 

Similar to Real World REST with Atom/AtomPub (20)

Rest web services
Rest web servicesRest web services
Rest web services
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
Django Overview
Django OverviewDjango Overview
Django Overview
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practice
 
Darwin web standards
Darwin web standardsDarwin web standards
Darwin web standards
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
 
ERRest: the Basics
ERRest: the BasicsERRest: the Basics
ERRest: the Basics
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
REST Api Tips and Tricks
REST Api Tips and TricksREST Api Tips and Tricks
REST Api Tips and Tricks
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 
Share point development 101
Share point development 101Share point development 101
Share point development 101
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Going on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web PerformanceGoing on an HTTP Diet: Front-End Web Performance
Going on an HTTP Diet: Front-End Web Performance
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 

Real World REST with Atom/AtomPub

  • 1. Real World REST with Atom/AtomPub
  • 2. What is REST? • set of design principles • widely implemented (the Web!) • a term coined by Roy Fielding for his doctoral dissertation
  • 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. RESTful Apps • “play well” with others • are evolvable • are robust & maintainable • can be secure
  • 5. What is Atom? • a simple XML format • very similar to RSS • useful for representing web content
  • 6. What is AtomPub? • Atom Publishing Protocol • a standard for “writing” to the web • based on REST principles
  • 7. Who is implementing Atom/AtomPub? • Google • Microsoft • IBM • LAITS :-)
  • 8. REST principles • Everything is a Resource • Resources have Names • Simple operations (GET, PUT, POST, DELETE)
  • 9. REST principles • Resources have Representations • Hypermedia is the Engine of Application State
  • 10. REST principles in practice • Everything is a Resource • bookmarks • orders • employees • media files
  • 11. REST principles in practice • Resources have Names • http://del.icio.us/pkeane/rest • http://.../orders/234 • http://.../employee/pkeane • http://.../funnycats.jpg
  • 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. 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. 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. 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. REST principles in practice • Resources have Representations http://flickr.com/pkeane/set/33/image/2.jpg
  • 17. REST principles in practice • Hypertext is the Engine of Application State
  • 18. REST principles in practice • Hypertext is the Engine of Application State Huh?
  • 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. 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>
  • 22. RESTful Google Docs GET LAITS Google (Atom) Server POST (form) XHR (Atom) Browser
  • 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. Why REST? • Mash-ups & Web 2.0 • Atom, JSON, XHTML • Cloud Computing / Distributed Systems
  • 25. Topics/Ideas • loose coupling • “engineer for serendipity” • resources, not procedures • reuse
  • 26. Topics/Ideas • functional programming at web-scale • declarative syntaxes • high value on good specs • mime-types
  • 27. Topics/Ideas • decomposition • complex procedures can be modeled as document passing • simple/generic interfaces • UNIX philosophy