3. HYPERMEDIA
cannot be the engine
Hypermedia Heaven & Hell
Self-descriptive Salvation
Angels of Affordance
4. REST “REDUCES COUPLING”.
WS-*/ESB
RPC over HTTP
RESTful HTTP
Deg
Loo
Tigh
Des
Discovery
Identification
Binding
Platform
Interaction
Interface
Orientation Interface
Orientation
Model
Granularity
State
Evolution
Generated
Code
Generated
Code
Conversation
Discovery
Identification
Binding
Platform
Interaction
Model
Granularity
State
Evolution
Conversation
(a) RESTful HTTP (b) RPC over HTTP
Figure 3: Measuring the degree of coupling implied by different W
RESTful HTTP RPC over HTTP
REST RPC
C. Pautasso & E. Wilde, “Why is the Web Loosely Coupled? A Multi-Faceted Metric for Service Design”
5. REST HAS
A UNIFORM INTERFACE.
resources
representations
self-descriptiveness
hypermedia
17. DOES HYPERMEDIA
REDUCE COUPLING?
In each representation,
the server includes links
towards other resources.
NO.
How can the server know
what links its clients need?
18. DOES HYPERMEDIA
REDUCE COUPLING?
The server sends you an image.
Scale it.
Crop it.
But you want to do something else.
Black & white.
Make profile pic.
29. HYPERMEDIA
cannot be the engine
Hypermedia Heaven & Hell
Self-descriptive Salvation
Angels of Affordance
30. HYPERMEDIA RESPONSES SHOULD
AFFORD GOING TO NEXT STEPS.
Server: Here’s an image.
Client: Thanks. I want to scale it.
Server: I thought you would,
so I included a link.
31. HYPERMEDIA RESPONSES SHOULD
AFFORD GOING TO NEXT STEPS.
Client: Now use it as my
Facebook profile picture.
Server: Err…
why would you want to do that?
32. IT’S HARD TO IMAGINE ALL WAYS
IN WHICH CLIENTS USE YOUR API.
IMPOSSIBLE
SELF-DESCRIPTIVENESS
GIVES THEM A CHOICE.
33. COMBINE SELF-DESCRIPTIVENESS
OF AN API’S RESPONSES…
…WITH SELF-DESCRIPTIVENESS
OF AN API’S FUNCTIONALITY
“This is a photo
of Ellen.”
“This API takes an image,
returns a black & white version.”