Skip to Content
View all events

Learning Client Hypermedia from the Ground Up

Published by O'Reilly Media, Inc.

Intermediate content levelIntermediate

Go from simple JSON to advanced hypermedia in two days

In just six hours, spread over two three-hour sessions, Mike Amundsen will teach you how to convert an existing web application that relies only on plain JSON responses into one that relies primarily on hypermedia information. This modern approach to REST application architecture eliminates the need for API documentation and massively increases clients’ flexibility, as no prior knowledge of a given API or server is required.

Through a series of simple code-review and refactoring sessions, you’ll learn how to move specific knowledge of addresses, actions, and objects out of the client app and place that information into the messages passed between client and server. Along the way, you’ll learn how you can improve the resilience and stability of the client app while eliminating lines of code that introduce tight coupling and lead to unexpected breakage and needless versioning. As a result, you’ll have a more robust, adaptable, and resilient client that will reduce the need for versioning and repeated code/test/deploy cycles when the service changes over time. If you’re a frontend developer, API service provider, or software architect, this hands-on workshop offers valuable lessons and advice that you can immediately put to use in your own projects.

What you’ll learn and how you can apply it

By the end of this live, online course, you’ll understand:

  • What hypermedia APIs are all about and how to use them to reduce breaking changes in your web applications
  • The importance of the Object-Address-Actions (OAA) model and how to use it to build simple, robust client applications
  • The important differences between the simple application/JSON format and advanced structured formats like HAL, Siren, and Collection+JSON

And you’ll be able to:

  • Convert a tightly coupled JSON web client into a robust, adaptable hypermedia client
  • Write short, simple client-side rendering engines for structured media types like HAL, Siren, and Collection+JSON
  • Improve a JavaScript-based app's ability to adapt to changes in objects, URLs, and workflows without the need to rewrite and redeploy the application each time the server API changes

This live event is for you because...

  • You’re a client-side web app developer with solid HTML, CSS, and JSON skills who wants to minimize update time for a web app each time a new feature is added.
  • You’re a product or project leader for one or more browser-based web apps who wants to quickly, safely, and easily turn feedback into features.
  • You’re responsible for producing server-side web APIs for various clients and want to be able to release new features without breaking existing client applications.

Prerequisites

  • A working knowledge of JavaScript, HTML, and CSS
  • An understanding of HTTP
  • Experience with Git, GitHub, and Heroku (useful but not required)

Recommended preparation:

RESTful Web Clients (book)

RESTful Web Services (book)

Building Hypermedia APIs with Node and HTML5 (book)

REST, Hypermedia, and the Semantic Gap(video)

From Zero to Hypermedia in 30 Minutes (video)

Materials and downloads needed

  • A desktop, laptop, or other connected machine with the HTML, CSS, and JavaScript editor of your choice installed
  • (Optional) Node.js installed
  • (Optional) A GitHub account and a Heroku account

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Day 1: From zero to links

What is hypermedia and why use it?

  • Lecture: Hypermedia basics (10 minutes
  • H-Factors (5 minutes)
  • Quiz: Where's the H-Factor? (5 minutes)
  • Group discussion: Hypermedia advantages and drawbacks (10 minutes)

The plain JSON client

  • Lecture: The classic CRUD (Create-Read-Update-Delete) pattern (10 minutes)
  • Exercise: Install and run client (15 minutes)
  • Group discussion: Where does CRUD fall short? (10 minutes)

Break (10 minutes)

Plain JSON and change

  • Lecture: Adding the EmailField (10 minutes)
  • Exercise: Email support (15 minutes)
  • The OAA challenge (10 minutes)

The JSON link client

  • Lecture: Describing links (addresses) (10 minutes)
  • Exercise: Consuming links (15 minutes)
  • Group discussion: Why not stop here? (10 minutes)

Break(10 minutes)

The link client and change

  • Lecture: Adding the MarkComplete action (10 minutes)
  • Exercise: Including MarkComplete support (15 minutes)
  • Group discussion: When is the HAL media type a good fit? (10 minutes)

Day 2: From templates to profiles

The JSON template client

  • Lecture: Describing actions (templates) (10 minutes)
  • Exercise: Including templates (20 minutes)
  • Quiz: Is this a template? (5 minutes)

The JSON template client and change

  • Lecture: Adding the TagField (10 minutes)
  • Exercise: Including TagField support (15 minutes)
  • Group discussion: What does the Siren media type do differently? (10 minutes)

Break (10 minutes)

The JSON profile client

  • Lecture: Describing display profiles (10 minutes)
  • Exercise: Including POD support (15 minutes)
  • Group discussion: Can we improve POD? (10 minutes)

The JSON profile client and change

  • Lecture: Adding the Notes object workflow (10 minutes)
  • Exercise: Including Notes support (20 minutes)
  • Group discussion: Why use the Collection+JSON media type? (10 minutes)

Break (10 minutes)

Summary and wrap-up

  • The OAA challenge (5 minutes)
  • H-Factors for APIs (5 minutes)
  • Client capabilities: Plain, link, template, and profile (10 minutes)
  • Quiz: Pin the client on the media type (5 minutes)

Your Instructor

Mike Amundsen

An internationally known author and speaker, Mike Amundsen consults with organizations around the world on network architecture, web development, and the intersection of technology and society. He helps companies large and small capitalize on the opportunities provided by APIs, microservices, and digital transformation. Mike has authored numerous books and papers. His book _Design and Build Great Web APIs _(Pragmatic Programmers) is an oft-cited reference. Mike’s other works include the O’Reilly books RESTful Web API Patterns and Practices Cookbook, RESTful Web Clients, and Microservice Architecture (coauthor), and he also contributed to O’Reilly’s popular Continuous API Management.

Xlinksearch

Skill covered

Web APIs