SlideShare une entreprise Scribd logo
1  sur  36
HYPERMEDIA

cannot be the engine
HYPERMEDIA

cannot be the engine
Ruben Verborgh

Ghent University – iMinds
“REST APIS MUST BE

HYPERTEXT-DRIVEN.”
Roy T. Fielding
HYPERMEDIA

cannot be the engine
Hypermedia Heaven & Hell
Self-descriptive Salvation
Angels of Affordance
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”
REST HAS

A UNIFORM INTERFACE.
resources
representations
self-descriptiveness
hypermedia
RESOURCES
identify resources, not actions
resources are cacheable
REPRESENTATIONS
share identifiers across systems
different needs,

different representations
SELF-DESCRIPTIVENESS
no external documentation
clients interpret representations
HYPERMEDIA
no hard-coded URLs
retrieve a resource,
follow links
SO FAR

FROM HEAVEN
so close

to hell.
DOES SELF-DESCRIPTIVENESS
REDUCE COUPLING?
YES.
only the message itself

is needed for interpretation
“in-band”
DOES SELF-DESCRIPTIVENESS
REDUCE COUPLING?
NO.
REST APIs rely on media types.
“in-band”??
SO YOU UNDERSTAND JSON?
application/alto-costmap+json
application/alto-costmapfilter+json
application/alto-directory+json
application/alto-endpointprop+json
application/alto-endpointpropparams+json
application/alto-endpointcost+json
application/alto-endpointcostparams+json
application/alto-error+json
application/alto-networkmapfilter+json
application/alto-networkmap+json
application/jrd+json
application/json
application/json-patch+json
application/ld+json
application/reputon+json
application/vcard+json
application/vnd.api+json
application/vnd.bekitzur-stech+json
application/vnd.collection.doc+json
application/vnd.collection+json
application/vnd.collection.next+json
application/vnd.document+json
application/vnd.hal+json
application/vnd.heroku+json
application/vnd.oftn.l10n+json
application/vnd.siren+json
application/vnd.xacml+json
DOES SELF-DESCRIPTIVENESS
REDUCE COUPLING?
Clients can interpret the message

using only in-band information…
…if they understand

the media type…
…which is out-of-band.
DOES HYPERMEDIA
REDUCE COUPLING?
In each representation,
the server includes links
towards other resources.
DOES HYPERMEDIA
REDUCE COUPLING?
YES.
Clients don’t hard-code

a server’s URLs.
Clients don’t hard-code

the path to information.
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?
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.
HYPERMEDIA

cannot be the engine
media type coupling
affordance coupling
HYPERMEDIA

cannot be the engine
Hypermedia Heaven & Hell
Self-descriptive Salvation
Angels of Affordance
ENOUGH WITH THE

MEDIA TYPES ALREADY.
CHOOSE A SELF-DESCRIPTIVE

MEDIA TYPE.
JSON is just JSON.
“image” likely has

a hundred meanings.
CHOOSE A SELF-DESCRIPTIVE

MEDIA TYPE.
JSON-LD is self-descriptive.
“image” is actually a URL.
Clients can look it up.
CHOOSE A SELF-DESCRIPTIVE

MEDIA TYPE.
The client still has to

understand this media type.
But it’s not task-

or application-specific.
ADD SELF-DESCRIPTIVE

HYPERMEDIA CONTROLS.
<form>
<label>Person:</label>
<input name=“person” />
</form>
What does this do?
ADD SELF-DESCRIPTIVE

HYPERMEDIA CONTROLS.
Hydra
inside JSON-LD response
relate controls

to data properties
DESCRIBE THE

API BEFOREHAND.
in a hypermedia-based way
describe the links
(imageA) —B&W—> (imageB)
DESCRIBE THE

API BEFOREHAND.
in a resource-based way
describe the functionality
(imageA) ——> (imageB&W)
HYPERMEDIA

cannot be the engine
Hypermedia Heaven & Hell
Self-descriptive Salvation
Angels of Affordance
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.
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?
IT’S HARD TO IMAGINE ALL WAYS

IN WHICH CLIENTS USE YOUR API.
IMPOSSIBLE
SELF-DESCRIPTIVENESS

GIVES THEM A CHOICE.
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.”
…TO COMPLETE THE INTERACTION

THAT HYPERMEDIA COULDN’T.
HYPERMEDIA
can be the engine
of a single API.
HYPERMEDIA
cannot the engine
of cross-API interactions.
BUILDING API
DESCRIPTIONS
is thinking about Web APIs
on a Web scale.

Contenu connexe

Tendances

Querying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern FragmentsQuerying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern Fragments
Ruben Verborgh
 
Introduction to Linked Data 1/5
Introduction to Linked Data 1/5Introduction to Linked Data 1/5
Introduction to Linked Data 1/5
Juan Sequeda
 
RESTful JSON web databases
RESTful JSON web databasesRESTful JSON web databases
RESTful JSON web databases
kriszyp
 
Rest With Json Vs Soap With Xml
Rest With Json Vs Soap With XmlRest With Json Vs Soap With Xml
Rest With Json Vs Soap With Xml
Kaniska Mandal
 
Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011
Juan Sequeda
 

Tendances (20)

Reasoned SPARQL
Reasoned SPARQLReasoned SPARQL
Reasoned SPARQL
 
DBpedia's Triple Pattern Fragments
DBpedia's Triple Pattern FragmentsDBpedia's Triple Pattern Fragments
DBpedia's Triple Pattern Fragments
 
The Lonesome LOD Cloud
The Lonesome LOD CloudThe Lonesome LOD Cloud
The Lonesome LOD Cloud
 
Linked Data Fragments
Linked Data FragmentsLinked Data Fragments
Linked Data Fragments
 
Building materialised views for linked data systems using microservices
Building materialised views for linked data systems using microservicesBuilding materialised views for linked data systems using microservices
Building materialised views for linked data systems using microservices
 
GraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database accessGraphQL and its schema as a universal layer for database access
GraphQL and its schema as a universal layer for database access
 
Linking media, data, and services
Linking media, data, and servicesLinking media, data, and services
Linking media, data, and services
 
schema.org, Linked Data's Gateway Drug
schema.org, Linked Data's Gateway Drugschema.org, Linked Data's Gateway Drug
schema.org, Linked Data's Gateway Drug
 
Querying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern FragmentsQuerying federations 
of Triple Pattern Fragments
Querying federations 
of Triple Pattern Fragments
 
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4jExplicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
Explicit Semantics in Graph DBs Driving Digital Transformation With Neo4j
 
Adding Rules on Existing Hypermedia APIs
Adding Rules on Existing Hypermedia APIsAdding Rules on Existing Hypermedia APIs
Adding Rules on Existing Hypermedia APIs
 
Introduction to Linked Data 1/5
Introduction to Linked Data 1/5Introduction to Linked Data 1/5
Introduction to Linked Data 1/5
 
RESTful JSON web databases
RESTful JSON web databasesRESTful JSON web databases
RESTful JSON web databases
 
Rest With Json Vs Soap With Xml
Rest With Json Vs Soap With XmlRest With Json Vs Soap With Xml
Rest With Json Vs Soap With Xml
 
RDFa Semantic Web
RDFa Semantic WebRDFa Semantic Web
RDFa Semantic Web
 
Open Data and Web API
Open Data and Web APIOpen Data and Web API
Open Data and Web API
 
Building Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRSBuilding Self Documenting HTTP APIs with CQRS
Building Self Documenting HTTP APIs with CQRS
 
Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011
 
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
FIWARE Global Summit - NGSI-LD: Modelling, Linking and Utilizing Context Info...
 
Creating 3rd Generation Web APIs with Hydra
Creating 3rd Generation Web APIs with HydraCreating 3rd Generation Web APIs with Hydra
Creating 3rd Generation Web APIs with Hydra
 

Similaire à Hypermedia Cannot be the Engine

Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and Jersey
Chris Winters
 

Similaire à Hypermedia Cannot be the Engine (20)

Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State Transfer
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 
How RESTful Is Your REST?
How RESTful Is Your REST?How RESTful Is Your REST?
How RESTful Is Your REST?
 
Introduction to REST and Jersey
Introduction to REST and JerseyIntroduction to REST and Jersey
Introduction to REST and Jersey
 
The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
-overview of res tful architecture-2
-overview of res tful architecture-2-overview of res tful architecture-2
-overview of res tful architecture-2
 
REST Architecture with use case and example
REST Architecture with use case and exampleREST Architecture with use case and example
REST Architecture with use case and example
 
REST Architecture with use case and example
REST Architecture with use case and exampleREST Architecture with use case and example
REST Architecture with use case and example
 
Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with Hypermedia
 
Treinamento 1
Treinamento 1Treinamento 1
Treinamento 1
 
Introduction to Hydra
Introduction to HydraIntroduction to Hydra
Introduction to Hydra
 
Rest introduction
Rest introductionRest introduction
Rest introduction
 
Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
 
Creating Restful Web Services with restish
Creating Restful Web Services with restishCreating Restful Web Services with restish
Creating Restful Web Services with restish
 
Distributed affordance: An Open-World Assumption for Hypermedia
Distributed affordance: An Open-World Assumption for HypermediaDistributed affordance: An Open-World Assumption for Hypermedia
Distributed affordance: An Open-World Assumption for Hypermedia
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
 
REST Fest 2012: HATEOAS Your Cake and Eat It Too
 REST Fest 2012: HATEOAS Your Cake and Eat It Too REST Fest 2012: HATEOAS Your Cake and Eat It Too
REST Fest 2012: HATEOAS Your Cake and Eat It Too
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?
 
A Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity ServicesA Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity Services
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Hypermedia Cannot be the Engine