Building a client API that allows you to scale and evolve is a delicate task. If your API is intended to be used with mobile devices the problem's of latency, bandwidth uncertain connection state, multiple client versions and capabilities compound the problem. See how PlayUp has used hypermedia (ReST) to power and evolve it's applications on iOS, Android, Windows Phone and Windows 8. See a general overview of the principles that guide development, how the client and the server work, the 'oh I wish we hadn't done that moments' and take a tour of the document exchanges that power PlayUp's ticketing service.
2. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
3. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
4. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
5. Roadmap
• ReST and Hypermedia
• An example of a Hypermedia driven service
• Tips & Trips
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
6. A jumping off point
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
10. Representational State Transfer (ReST) is a
style of software architecture for distributed
hypermedia systems such as the
World Wide Web
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
12. ReST is not a
meaningful term
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
13. One URL ≠ ReST
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
14. One URL ≠ ReST
http://example.com/system?action=getUser&uid=3
http://example.com/system?action=mkUser&name=…
http://example.com/system?action=rmUser&uid=3
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
15. Resources = ReST ?
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
16. Resources = ReST ?
http://example.com/users/3
http://example.com/users/<uid>
http://example.com/users/<uid>/friends
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
17. HTTP Verbs = ReST ?
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
18. HTTP Verbs = ReST ?
POST
http://example.com/users
GET
http://example.com/users/3
PUT
http://example.com/users/3
DELETE
http://example.com/users/3
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
19. What is ReST really?
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
20. "ReST is software design on the scale of
decades: every detail is intended to promote
software longevity and independent evolution.
Many of the constraints are directly opposed
to short-term efficiency. Unfortunately, people
are fairly good at short-term design, and
usually awful at long-term design."
Roy Fielding
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
21. The constraints of
ReST
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
29. Identification of
Resources
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
30. Manipulation of
resources through
representations
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
31. Self-descriptive
messages
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
32. Hypermedia as the
engine of application
state
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
33. “What needs to be done to make the ReST
architectural style clear on the notion that
hypertext is a constraint? In other words, if the
engine of application state (and hence the
API) is not being driven by hypertext, then it
cannot be ReSTful and cannot be a ReST API.
Period. Is there some broken manual
somewhere that needs to be fixed?”
Roy T. Fielding
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
34. A Hypermedia driven
service
Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013