Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application...

22
COMMUNICATE HOW TO OR “HOW WE CAN CREATE MORE MEANINGFUL, EXPRESSIVE INTERFACES, BUILD DYNAMIC CLIENT LIBRARIES & POWERFUL CLIENT TOOLING, & MOVE TOWARDS REALTIME HYPERMEDIA APIS.”

Transcript of Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application...

Page 1: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

COMMUNICATEHOW TO

OR… “HOW WE CAN CREATE MORE MEANINGFUL, EXPRESSIVE INTERFACES, BUILD DYNAMIC CLIENT LIBRARIES & POWERFUL CLIENT TOOLING,

& MOVE TOWARDS REALTIME HYPERMEDIA APIS.”

Page 2: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

LIMITATIONS OF OUR CURRENT APIS

▸ Not self-descriptive.

▸ Complexity as APIs grow. Ad-hoc endpoints.

▸ Can be inefficient. Multiple round-trips & overfetch.

▸ What about realtime?

Page 3: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

TACKLING API COMPLEXITY

▸ Schemas - API description, typically for documentation.

▸ Hypermedia - Modest uptake, no killer tooling.

▸ Graph QL - Motived by inefficiency & complexity.

Page 4: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

THE FUNDAMENTALSWhat interface does the service present?

Page 5: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

▸ Define a DOM that clients interact with.

▸ Decouple the encoding and transport concerns.

Page 6: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

THE DOCUMENT MODEL

▸ Data: {…}, […],123, 123.456, “String”, true, false, null.

▸ Documents: Some content with an associated URL.

▸ Links: A URL, an action, and optionally some parameters.

Page 7: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

THE DOCUMENT MODEL▸ Documents can be nested.

▸ Contain both links and data.

▸ Support either schemas or hypermedia.

Page 8: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

INTERACTING USING CORE API▸ Client only interfaces at the document layer.

▸ Not concerned with network details in any way.

▸ Multiple encodings & transports supported.

Page 9: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

1.

HOW TO COMMUNICATE

4.

2.

3.

Page 10: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

▸ Provide the document to act on.

▸ Index to a link in the document.

▸ Possibly some named parameters.

HOW TO COMMUNICATE

INTERACTING WITH OUR API

Page 11: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

MEANINGFUL INTERACTIONS

▸ Building network requests…

▸ Performing interactions…

Page 12: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

INTERACTING WITH EXISTING SERVICES

Page 13: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

INTERACTING WITH EXISTING SERVICES

Page 14: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

CLIENT TOOLING

Page 15: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

MULTIPLE ENCODINGS▸ Core API servers can respond with a range of encodings.

Page 16: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

PARTIAL TRANSITIONS▸ Interact with nested documents.

▸ Replace only the relevant part of the document tree.

Page 17: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

RICH INTERFACES

Page 18: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

RICH INTERFACES▸ Not constrained to CRUD style APIs.

Page 19: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

REALTIME HYPERMEDIA APIS

1.

4.

2.

3.

5.

Page 20: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

REALTIME HYPERMEDIA APIS▸ WebSockets support for realtime APIs.

Page 21: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

HOW TO COMMUNICATE

SUMMARY

▸ Meaningful, self-descriptive interfaces.

▸ Able to interact with existing schema/hypermedia formats.

▸ Schemas for an easy win. Hypermedia for rich interfaces.

▸ Encourages an interface-first API design style.

▸ Allows for powerful client tooling.

▸ Realtime Hypermedia APIs.

Page 22: Real-time hypermedia APIs: Exploring the fundamentals of how we build networked application interfaces

THANKS!

Twitter: @_tomchristie

www.coreapi.org