SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Hypermedia API
      Pavel Mitin
   2012 Anadea Inc.
Why does it matter
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API..
Problem
Existing APIs are often:
● unclear
● fragile
● not extendable
Possible solution
“WWW is fundamentally a distributed
hypermedia application.” Richard Taylor
Possible solution
“WWW is fundamentally a distributed
hypermedia application.” Richard Taylor

And the application works!
How WEB works
Browsers know how to:
● deal with media types (text/html,
  image/png...)
● navigate via links and submit forms
How WEB works
Browsers know how to:
● deal with media types (text/html,
  image/png...)
● navigate via links and submit forms

Let’s follow the example!!!
Example -- eBay API
GET .../item/180881974947
{
  "name" : "Monty Python and the Holy Grail white rabbit big pointy teeth",
  "id" : "180881974947",
  ...
  "links" : [
    { “type: "application/vnd.ebay.item",
      "rel": "Add item to watchlist",
      "href": "https://.../user/12345678/watchlist/180881974947"},
    { // and a whole lot of other operations ]}


Source: http://www.slideshare.net/josdirksen/rest-from-get-to-hateoas
Media types
●   application/atom+xml
●   image/jpeg
●   audio/vnd.wave
●   application/vnd.buyfolio.listing+json
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..."   />
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..." />
● Outbound Links
  ○ <a href="..." target="_blank">...</a>
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..." />
● Outbound Links
  ○ <a href="..." target="_blank">...</a>
● Templated Links
  ○ <form method="get" action="...">...</form>
  ○ <link href="http://www.example.org/?search={search}"   />
Hypermedia links
● Embed Links
   ○ <img src="..." />
   ○ <x:include href"..." />
● Outbound Links
   ○ <a href="..." target="_blank">...</a>
● Templated Links
   ○ <form method="get" action="...">...</form>
   ○ <link href="http://www.example.org/?search={search}"   />
● Idempotent Links
   ○ <link rel="edit" href="http://example.org/edit/1"/>
   ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
Hypermedia links
● Embed Links
   ○ <img src="..." />
   ○ <x:include href"..." />
● Outbound Links
   ○ <a href="..." target="_blank">...</a>
● Templated Links
   ○ <form method="get" action="...">...</form>
   ○ <link href="http://www.example.org/?search={search}"   />
● Idempotent Links
   ○ <link rel="edit" href="http://example.org/edit/1"/>
   ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
● Non-Idempotent Links
   ○ <form method="post" action="...">...</form>
Hypermedia Design Elements
1.   Base Format
2.   State Transfer
3.   Domain Style
4.   Application Flow
Base format
1.   JSON
2.   XML
3.   XHTML/HTML5
4.   Others (YAML, CSV, Markdown, Protocol
     Buffers)
State Transfer (client-initiated)
1. None (i.e. read-only)
2. Predefined (via external documentation)
3. Ad-Hoc (via in-message hypermedia
   controls)
Domain Style
1. Specific
2. General
3. Agnostic
Domain Style
<!-- domain-specific design -->
<story>
  <id>...</id>
  <estimate>...</estimate>
</story>
Domain Style
/* domain-general design */
{
    "collection" : {
        "items" : {
            { "key" : "id",
              "value" : "12345" }
        ...
Domain Style
<!-- domain-agnostic design -->
<ul class="order">
  <li class="id">...</li>
  <ul class="shipping-address">
    <li class="street-address">...</li>
    ...
I haven't mentioned
● Resources
● Http verbs
● Http status codes
Surfing your API




Source: Building Hypermedia APIs with HTML5 and Node by Mike Amundsen
XHTML as a base format
●   Native support for links and forms
●   Ubiquitous client (browser)
●   XHTML is XML
●   HAML :)
Extending vs versioning
Reasons for a new version:
● A change that alters the meaning or
  functionality of an existing feature or
  element
● A change that causes an existing element to
  disappear or become disallowed
● A change that converts an optional element
  into a required element
Javascript RIA
;)
Criticism
Usually compared to "traditional" REST API
Criticism
● Overcomplicated client
● Extra traffic
Rails and HATEOAS
● lack of abstractions for hypermedia controls
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are two different resources
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
  ○ upsert
  ○ whole resource state
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
  ○ upsert
  ○ whole resource state
● custom media types require custom code
Richardson Maturity Model




Source: http://martinfowler.com/articles/richardsonMaturityModel.html
Books

Weitere ähnliche Inhalte

Andere mochten auch

HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCL Technologies
 
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud Alexander SAMARIN
 
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenHow to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenAvisi B.V.
 
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyLegacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyOSSCube
 
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Inc
 
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupLeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupRolph Haspers
 
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers WSO2
 
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project ILM Professional Services
 
IO State In Distributed API Architecture
IO State In Distributed API ArchitectureIO State In Distributed API Architecture
IO State In Distributed API ArchitectureOwen Rubel
 
Api Abstraction & Api Chaining
Api Abstraction & Api ChainingApi Abstraction & Api Chaining
Api Abstraction & Api ChainingOwen Rubel
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingkumar gaurav
 
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsBuilding a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsC4Media
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationColin Bell
 
Building an API Platform for Digital Transformation
Building an API Platform for Digital TransformationBuilding an API Platform for Digital Transformation
Building an API Platform for Digital TransformationWSO2
 
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Bruce Schonk -PMP, MBA
 
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...Renaud Visage
 
API Architecture
API ArchitectureAPI Architecture
API ArchitectureRyan Kolak
 

Andere mochten auch (18)

HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization
 
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud
 
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenHow to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris Lukassen
 
Apiworld
ApiworldApiworld
Apiworld
 
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyLegacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case study
 
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Signal 2016 API Architecture
Twilio Signal 2016 API Architecture
 
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupLeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL Meetup
 
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers
 
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project
 
IO State In Distributed API Architecture
IO State In Distributed API ArchitectureIO State In Distributed API Architecture
IO State In Distributed API Architecture
 
Api Abstraction & Api Chaining
Api Abstraction & Api ChainingApi Abstraction & Api Chaining
Api Abstraction & Api Chaining
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
 
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsBuilding a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The Essentials
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
 
Building an API Platform for Digital Transformation
Building an API Platform for Digital TransformationBuilding an API Platform for Digital Transformation
Building an API Platform for Digital Transformation
 
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9
 
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
 
API Architecture
API ArchitectureAPI Architecture
API Architecture
 

Ähnlich wie Hypermedia api (HATEOAS)

The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Akana
 
Website Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepWebsite Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepMia Lee
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGabriel Lucaciu
 
API Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyAPI Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyBill Doerrfeld
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsSmartLogic
 
01 web 2.0 - more than a pretty face for soa
01   web 2.0 - more than a pretty face for soa01   web 2.0 - more than a pretty face for soa
01 web 2.0 - more than a pretty face for soaTechnology Transfer
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraAPI Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraCA API Management
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsDougal Campbell
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTORoy Sivan
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto PresentationRoy Sivan
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Gustaf Nilsson Kotte
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
On-page SEO for Drupal
On-page SEO for DrupalOn-page SEO for Drupal
On-page SEO for DrupalSvilen Sabev
 
Webcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationWebcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationApigee | Google Cloud
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbSmartLogic
 

Ähnlich wie Hypermedia api (HATEOAS) (20)

The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
 
Yahoo for the Masses
Yahoo for the MassesYahoo for the Masses
Yahoo for the Masses
 
Website Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepWebsite Optimization -SEO - Step By Step
Website Optimization -SEO - Step By Step
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
 
API Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyAPI Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and Advocacy
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIs
 
01 web 2.0 - more than a pretty face for soa
01   web 2.0 - more than a pretty face for soa01   web 2.0 - more than a pretty face for soa
01 web 2.0 - more than a pretty face for soa
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraAPI Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie Mitra
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the Guts
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
On-page SEO for Drupal
On-page SEO for DrupalOn-page SEO for Drupal
On-page SEO for Drupal
 
Webcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationWebcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next Generation
 
The Open Web
The Open WebThe Open Web
The Open Web
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rb
 
Api craft notes
Api craft notesApi craft notes
Api craft notes
 
API Design Tour: Digital River
API Design Tour: Digital RiverAPI Design Tour: Digital River
API Design Tour: Digital River
 

Kürzlich hochgeladen

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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​Bhuvaneswari Subramani
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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, ...Angeliki Cooney
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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 FMESafe Software
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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 Ontologyjohnbeverley2021
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
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 TerraformAndrey Devyatkin
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Kürzlich hochgeladen (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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​
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Hypermedia api (HATEOAS)

  • 1. Hypermedia API Pavel Mitin 2012 Anadea Inc.
  • 2. Why does it matter API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API..
  • 3. Problem Existing APIs are often: ● unclear ● fragile ● not extendable
  • 4. Possible solution “WWW is fundamentally a distributed hypermedia application.” Richard Taylor
  • 5. Possible solution “WWW is fundamentally a distributed hypermedia application.” Richard Taylor And the application works!
  • 6. How WEB works Browsers know how to: ● deal with media types (text/html, image/png...) ● navigate via links and submit forms
  • 7. How WEB works Browsers know how to: ● deal with media types (text/html, image/png...) ● navigate via links and submit forms Let’s follow the example!!!
  • 8. Example -- eBay API GET .../item/180881974947 { "name" : "Monty Python and the Holy Grail white rabbit big pointy teeth", "id" : "180881974947", ... "links" : [ { “type: "application/vnd.ebay.item", "rel": "Add item to watchlist", "href": "https://.../user/12345678/watchlist/180881974947"}, { // and a whole lot of other operations ]} Source: http://www.slideshare.net/josdirksen/rest-from-get-to-hateoas
  • 9. Media types ● application/atom+xml ● image/jpeg ● audio/vnd.wave ● application/vnd.buyfolio.listing+json
  • 10. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." />
  • 11. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a>
  • 12. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" />
  • 13. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" /> ● Idempotent Links ○ <link rel="edit" href="http://example.org/edit/1"/> ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
  • 14. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" /> ● Idempotent Links ○ <link rel="edit" href="http://example.org/edit/1"/> ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id); ● Non-Idempotent Links ○ <form method="post" action="...">...</form>
  • 15. Hypermedia Design Elements 1. Base Format 2. State Transfer 3. Domain Style 4. Application Flow
  • 16. Base format 1. JSON 2. XML 3. XHTML/HTML5 4. Others (YAML, CSV, Markdown, Protocol Buffers)
  • 17. State Transfer (client-initiated) 1. None (i.e. read-only) 2. Predefined (via external documentation) 3. Ad-Hoc (via in-message hypermedia controls)
  • 18. Domain Style 1. Specific 2. General 3. Agnostic
  • 19. Domain Style <!-- domain-specific design --> <story> <id>...</id> <estimate>...</estimate> </story>
  • 20. Domain Style /* domain-general design */ { "collection" : { "items" : { { "key" : "id", "value" : "12345" } ...
  • 21. Domain Style <!-- domain-agnostic design --> <ul class="order"> <li class="id">...</li> <ul class="shipping-address"> <li class="street-address">...</li> ...
  • 22. I haven't mentioned ● Resources ● Http verbs ● Http status codes
  • 23. Surfing your API Source: Building Hypermedia APIs with HTML5 and Node by Mike Amundsen
  • 24. XHTML as a base format ● Native support for links and forms ● Ubiquitous client (browser) ● XHTML is XML ● HAML :)
  • 25. Extending vs versioning Reasons for a new version: ● A change that alters the meaning or functionality of an existing feature or element ● A change that causes an existing element to disappear or become disallowed ● A change that converts an optional element into a required element
  • 27. Criticism Usually compared to "traditional" REST API
  • 29. Rails and HATEOAS ● lack of abstractions for hypermedia controls
  • 30. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are two different resources
  • 31. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb
  • 32. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb
  • 33. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb ● PUT verb ○ upsert ○ whole resource state
  • 34. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb ● PUT verb ○ upsert ○ whole resource state ● custom media types require custom code
  • 35. Richardson Maturity Model Source: http://martinfowler.com/articles/richardsonMaturityModel.html
  • 36. Books