Hyper fantasy

9

Click here to load reader

description

From Manchester Geek Nights (http://upcoming.yahoo.com/event/6718576/MCR/Manchester/Hyper-Fantasy-Choose-your-path-through-the-world-of-REST-using-Restfulie/Kilburn-Building)

Transcript of Hyper fantasy

Page 1: Hyper fantasy

Hyper Fantasy

Adventures In Hypermedia

Jim Barritt

Page 2: Hyper fantasy

Prologue

• REST – Roy Fielding

• REST IN PRACTICE – Jim Webber, Ian Robinson, Savas Parastatdis

• RESTFULIE – Guilherme Silveira, Lucas Cavalcanti

Page 3: Hyper fantasy

Love to <Link>• Hypermedia Controls

• <atom:link href=“” rel=“” />

• <a href=“” rel=“” >Link to somewhere</a>

• Media types– application/xhtml+xml– text/html– application/xml– application/json– application/vnd.restbucks+xml

Page 4: Hyper fantasy

Talking in Http

• HEAD GET PUT POST DELETE

• 200 (ok)• 404 (not found)• 500 (internal error)• 418 (I’m a teapot)

– http://www.faqs.org/rfcs/rfc2324.html

• Accept: text/* application/xml

Page 5: Hyper fantasy

RESTafarianism• Client-Server

• Stateless

• Cacheable

• Layered System

• Uniform interface– Identification of resources– Manipulation of resources via representations– Self-descriptive messages– HATEOAS (Hypermedia as the engine of application state)

• Code on demand (optional)

Page 6: Hyper fantasy

Restfulie• Why would I use restfulie?

• 1. Easy —> writing hypermedia aware resource based clients

• 2. Easy —> hypermedia aware resource based services

• 3. Small → it’s not a bloated solution with a huge list of APIs

• 4. HATEOAS —> clients you are unaware of will not bother if you change your URIs

• 5. HATEOAS —> services that you consume will not affect your software whenever they change part of their flow or URIs

Page 7: Hyper fantasy

Hyperia

Page 8: Hyper fantasy

To the CODE!

Page 9: Hyper fantasy

Epilogue• http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

• http://www.facebook.com/RESTinPractice

• http://github.com/caelum/restfulie-java

London geek night 22nd November

• http://github.com/jimbarritt/spikes/tree/master/restfulie/