Presented at JAX London 2013
Hypermedia or HATEOAS APIs get a lot of air cover but there aren't many of them in the wild. This session will summarize the challenges that exist when building hypermedia REST API’s and explain why it’s worth it. We’ll take a comparative look at various different approaches for using hypermedia in a typical REST API, before taking a closer look at an approach that automatically generates links from a semantically rich API definition.
4. Goals
Levels of Hypermedia and advantages
Objective view
Avoid bigotry
New ideas
Propose and review REST DSLs
Tips & advice
Real world usage of Hypermedia
*
26. No Standardized Hypermedia Type
Hypermedia Type
Style
Version
HTML
Enrich
4.0.1
HTML Microformats
Enrich
XML
Enrich
1.1
ATOM
Wrap
RFC
HAL
Enrich
Draft
Collection-JSON
Wrap
Draft
Custom Media-Types
*
34. Level 2
• Defines entities at URIs w/ flat or
CRUD type services
• No links between resources
• Projects / examples
- Twitter
- Many others
*
35. Data Services
• Developers follow links before
ultimately consuming a Data Service
• API often still includes a version
• Projects / examples
- OData
-
-
PayPal API
GitHub v3
*
36. Interaction Services
• User-Agent let’s user follow links
• Available options and state are
described through links
*
• Projects / examples
-
-
IRIS
Restbucks
*
37. Shared Vocabulary
• Control navigation, state and
presentation
• Use a well defined media type /
shared vocabulary to control
certain aspects of validation &
rendering
• Projects / examples
- Restfulobjects, Apache ISIS
- Hydra, ALPS
*
38. Glory of Hypermedia
• Puts the user in total control
• Very well established; slowly
changing media types
• Projects / examples
- HTML5
- World Wide Web
46. Temenos Interaction Framework
• Of Interaction Framework (Hypermedia Server)…
- Reduce or eliminate client / server coupling
- Put the user in control (Object, Action)
- Reduce UI integration effort through mashup layer
*
47. Hypermedia Server
Temenos is donating a Java based
Hypermedia Server to the Open
Source Community
http://temenostech.temenos.com/
https://github.com/temenostech/IRIS
A project called IRIS; it has three
main goals:
1. To create web based services
according to RESTful constraints
2. Aggregate / mashup multiple
resource managers into a single
interaction service
3. Provide a language to describe
the interactions between these
resources
48. Resource Interaction Model (RIM)
• RIM language / example
-
-
-
-
Conditional links
Link relations
Auto transitions
Workflow
• HAL Browser
*
51. Summary
• Who do you want to be in control?
• Human end user?
• More adaptive client.
• MediaType Selection
• Hypermedia controls
• Enrich with links vs. wrap
• There is value in just using links.
- Whatever maturity level you use.
*