SlideShare una empresa de Scribd logo
1 de 27
Hypermedia and
ASP.NET Web API
     Glenn Block
      @gblock
Hypermedia 101
What is
   Hypermedia?                                   iou   s
                                            Prev
                                  Catalog
    Embedded links in HTTP                   Ne
                                               xt
responses which are application
       state transitions
What is
   Hypermedia?
    Embedded links in HTTP
responses which are application
       state transitions
What is
   Hypermedia?
    Embedded links in HTTP
responses which are application
       state transitions
What is                                      o va
                                                      l
                                                pr

   Hypermedia?                            A   p

                                              Fulfillment
                                  Order
    Embedded links in HTTP                Ca
                                            nc
responses which are application               el
                                                lat
                                                    io
                                                          n
       state transitions
What is
Hypermedia?
 Not a new concept
What is
Hypermedia?
 Not a new concept
What is
Hypermedia?
 Not a new concept
What is
Hypermedia?
 Not a new concept
What is
Hypermedia?
 Not a new concept
What is
Hypermedia?
 Not a new concept
What is a
Hypermedia API            API
 A web API that returns
  responses containing
      hypermedia
What is a
Hypermedia API
     Not this
What is a
Hypermedia API
   This is better
What is a
Hypermedia API
 And this is really good
How does a
hypermedia work?          API
 Server embeds links to
       resources
How does a
 hypermedia work?                   Client
Clients identifies available links
   and their associated urls
How does a
hypermedia work?
                                      Client
Client navigates to the chosen link
Hypermedia
The concept is simple
Hypermedia and
   Web API
How do we implement it?
COLLECTION
                                 +JSON          HTML




                               HAL           ATOM

    Media Types
Hypermedia is conventionally
surfaced via the media type          SIREN


  Hypermedia can also be
   surfaced via headers
Formatters and               Media Type

     Hypermedia
                                Formatter


                                Media Type      API
Formatters create media type    Formatter    Controller
 representations from objects
                                Media Type
 Formatters are the key place   Formatter
for hypermedia to be rendered
Controller



      Media Type
                                                           populates a
                                                           model with
                                                               links




       Models
                                Media Type                         API
  One approach is to have a     Formatter                       Controller
  media type specific model
                                             Formatter
                                             renders the

The application populates the                 model and
                                                links

model, and a custom formatter
          renders it
Controller


       Media Type
                                                            returns a set
                                                               of DTOs




       Templates
                                  Media Type                         API
Another is to have media type     Formatter                       Controller
     specific templates.
                                               Formatter

The application returns a model                 renders
                                                template
                                               with links
    passed to a formatter.

The formatter renders using a
    a template (like razor)
Rest Agent

             Client
More information

http://codebetter.com/glennblock
http://amundsen.com/media-types/collection/
http://github.com/howarddierking/restbugs
http://github.com/tavis-software/RestAgent

Más contenido relacionado

Similar a Hypermedia

REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia ConstraintInviqa
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraintInviqa
 
Trends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonTrends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonCA API Management
 
API Athens Meetup - API standards 22.03.2016
API Athens Meetup - API standards 22.03.2016API Athens Meetup - API standards 22.03.2016
API Athens Meetup - API standards 22.03.2016Ivan Goncharov
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State TransferAlexei Skachykhin
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to APIrajnishjha29
 
Modern APIs: The Non-Technical User’s Guide | The Enterprise World
Modern APIs: The Non-Technical User’s Guide | The Enterprise WorldModern APIs: The Non-Technical User’s Guide | The Enterprise World
Modern APIs: The Non-Technical User’s Guide | The Enterprise WorldTEWMAGAZINE
 
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
 
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 CQRSDerek Comartin
 
Digital Methods Winterschool 2012: API - Interfaces to the Cloud
Digital Methods Winterschool 2012: API - Interfaces to the CloudDigital Methods Winterschool 2012: API - Interfaces to the Cloud
Digital Methods Winterschool 2012: API - Interfaces to the CloudDigital Methods Initiative
 
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialTom Hofte
 
Microservices&ap imanagement
Microservices&ap imanagementMicroservices&ap imanagement
Microservices&ap imanagementpramodkumards
 
ConnectME: connecting content for future TV & video
ConnectME: connecting content for future TV & videoConnectME: connecting content for future TV & video
ConnectME: connecting content for future TV & videoconnectme_project
 
API Days Berlin highlights
API Days Berlin highlightsAPI Days Berlin highlights
API Days Berlin highlightsAndrii Gakhov
 
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...WSO2
 
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Polyxer Systems
 
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.ai
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.aiapidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.ai
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.aiapidays
 
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
 

Similar a Hypermedia (20)

REST and the Hypermedia Constraint
REST and the Hypermedia ConstraintREST and the Hypermedia Constraint
REST and the Hypermedia Constraint
 
Rest and the hypermedia constraint
Rest and the hypermedia constraintRest and the hypermedia constraint
Rest and the hypermedia constraint
 
L11 Service Design and REST
L11 Service Design and RESTL11 Service Design and REST
L11 Service Design and REST
 
Trends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop LondonTrends in Web APIs Layer 7 API Management Workshop London
Trends in Web APIs Layer 7 API Management Workshop London
 
API Athens Meetup - API standards 22.03.2016
API Athens Meetup - API standards 22.03.2016API Athens Meetup - API standards 22.03.2016
API Athens Meetup - API standards 22.03.2016
 
Representational State Transfer
Representational State TransferRepresentational State Transfer
Representational State Transfer
 
Rest assured
Rest assuredRest assured
Rest assured
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Modern APIs: The Non-Technical User’s Guide | The Enterprise World
Modern APIs: The Non-Technical User’s Guide | The Enterprise WorldModern APIs: The Non-Technical User’s Guide | The Enterprise World
Modern APIs: The Non-Technical User’s Guide | The Enterprise World
 
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?
 
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
 
Digital Methods Winterschool 2012: API - Interfaces to the Cloud
Digital Methods Winterschool 2012: API - Interfaces to the CloudDigital Methods Winterschool 2012: API - Interfaces to the Cloud
Digital Methods Winterschool 2012: API - Interfaces to the Cloud
 
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorialO'Reilly SACon San Jose, CA - 2019 - API design tutorial
O'Reilly SACon San Jose, CA - 2019 - API design tutorial
 
Microservices&ap imanagement
Microservices&ap imanagementMicroservices&ap imanagement
Microservices&ap imanagement
 
ConnectME: connecting content for future TV & video
ConnectME: connecting content for future TV & videoConnectME: connecting content for future TV & video
ConnectME: connecting content for future TV & video
 
API Days Berlin highlights
API Days Berlin highlightsAPI Days Berlin highlights
API Days Berlin highlights
 
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
Apply API Governance to RESTful Service APIs using WSO2 Governance Registry a...
 
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
 
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.ai
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.aiapidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.ai
apidays London 2023 - Autonomous Agents, Zdenek Nemec, superface.ai
 
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
 

Más de Glenn Block

Api Strat Portland 2017 Serverless Extensibility talk
Api Strat Portland 2017 Serverless Extensibility talkApi Strat Portland 2017 Serverless Extensibility talk
Api Strat Portland 2017 Serverless Extensibility talkGlenn Block
 
Serverless Extensibility
Serverless ExtensibilityServerless Extensibility
Serverless ExtensibilityGlenn Block
 
Deploying web apis on core clr to docker
Deploying web apis on core clr to dockerDeploying web apis on core clr to docker
Deploying web apis on core clr to dockerGlenn Block
 
HTTP Event Collector, Simplified Developer Logging
HTTP Event Collector, Simplified Developer LoggingHTTP Event Collector, Simplified Developer Logging
HTTP Event Collector, Simplified Developer LoggingGlenn Block
 
Liberate your Application Logging
Liberate your Application LoggingLiberate your Application Logging
Liberate your Application LoggingGlenn Block
 
A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3Glenn Block
 
Islands of Node in a sea of big data
Islands of Node in a sea of big dataIslands of Node in a sea of big data
Islands of Node in a sea of big dataGlenn Block
 
Splunk, a smorgasboard for developing big data solutions
Splunk, a smorgasboard for developing big data solutions Splunk, a smorgasboard for developing big data solutions
Splunk, a smorgasboard for developing big data solutions Glenn Block
 
Splunk's api how we built it
Splunk's api   how we built itSplunk's api   how we built it
Splunk's api how we built itGlenn Block
 
Splunk for net developers
Splunk for net developersSplunk for net developers
Splunk for net developersGlenn Block
 
Dev sum hypemedia talk
Dev sum hypemedia talkDev sum hypemedia talk
Dev sum hypemedia talkGlenn Block
 
Getting your head around big data
Getting your head around big dataGetting your head around big data
Getting your head around big dataGlenn Block
 
Realtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devRealtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devGlenn Block
 
Node js on Windows Azure
Node js on Windows AzureNode js on Windows Azure
Node js on Windows AzureGlenn Block
 
Building systems with rest
Building systems with restBuilding systems with rest
Building systems with restGlenn Block
 
Building Extensible RIAs with MEF
Building Extensible RIAs with MEFBuilding Extensible RIAs with MEF
Building Extensible RIAs with MEFGlenn Block
 

Más de Glenn Block (18)

Api Strat Portland 2017 Serverless Extensibility talk
Api Strat Portland 2017 Serverless Extensibility talkApi Strat Portland 2017 Serverless Extensibility talk
Api Strat Portland 2017 Serverless Extensibility talk
 
Serverless Extensibility
Serverless ExtensibilityServerless Extensibility
Serverless Extensibility
 
Deploying web apis on core clr to docker
Deploying web apis on core clr to dockerDeploying web apis on core clr to docker
Deploying web apis on core clr to docker
 
HTTP Event Collector, Simplified Developer Logging
HTTP Event Collector, Simplified Developer LoggingHTTP Event Collector, Simplified Developer Logging
HTTP Event Collector, Simplified Developer Logging
 
Liberate your Application Logging
Liberate your Application LoggingLiberate your Application Logging
Liberate your Application Logging
 
A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3
 
Islands of Node in a sea of big data
Islands of Node in a sea of big dataIslands of Node in a sea of big data
Islands of Node in a sea of big data
 
Splunk and node
Splunk and nodeSplunk and node
Splunk and node
 
Splunk, a smorgasboard for developing big data solutions
Splunk, a smorgasboard for developing big data solutions Splunk, a smorgasboard for developing big data solutions
Splunk, a smorgasboard for developing big data solutions
 
Splunk's api how we built it
Splunk's api   how we built itSplunk's api   how we built it
Splunk's api how we built it
 
Splunk for net developers
Splunk for net developersSplunk for net developers
Splunk for net developers
 
Dev sum hypemedia talk
Dev sum hypemedia talkDev sum hypemedia talk
Dev sum hypemedia talk
 
Getting your head around big data
Getting your head around big dataGetting your head around big data
Getting your head around big data
 
Edge
EdgeEdge
Edge
 
Realtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js devRealtime Conf - Lightning node.js dev
Realtime Conf - Lightning node.js dev
 
Node js on Windows Azure
Node js on Windows AzureNode js on Windows Azure
Node js on Windows Azure
 
Building systems with rest
Building systems with restBuilding systems with rest
Building systems with rest
 
Building Extensible RIAs with MEF
Building Extensible RIAs with MEFBuilding Extensible RIAs with MEF
Building Extensible RIAs with MEF
 

Hypermedia

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n