evolvable apis - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf ·...

117
Twelve Patterns for Evolvable APIs Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas

Upload: others

Post on 09-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Twelve Patterns for Evolvable APIs

Mike AmundsenAPI Academy / CA

@mamund

Drawings by Diogo Lucas@diogoclucas

Page 2: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Introduction

Page 3: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 4: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

http://apiacademy.co

Page 5: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 6: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

@RWCBook

Page 7: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Outline• Hypermedia• Messages• Patterns• 4+4+4• Summary

Page 8: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia

Page 9: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

What is Hypermedia?Hypertext is text which is not constrained to be linear. Hypertext is text which contains links to other texts.

The term was coined by Ted Nelson around 1965.https://www.w3.org/WhatIs.html

Page 10: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

What is Hypermedia?Hypermedia is a term used for hypertext which is not constrained to be text: it can include graphics, video and sound, for example.

https://www.w3.org/WhatIs.html

Page 11: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

What is Hypermedia?

Hypertext and Hypermedia are concepts, not products.

https://www.w3.org/WhatIs.html

Page 12: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia is the language of the WWW

Page 13: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Why Hypermedia?

Page 14: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Why Hypermedia?Affordances!

Page 15: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Affordances"The affordances of the environment are what it

offers ... what it provides or furnishes, either for good or ill.

James Gibson, 1977

Page 16: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Affordances“The term affordance refers to the perceived and

actual properties of the thing, primarily those fundamental properties that determine just how

the thing could possibly be used.”

Donald Norman, 1988

Page 17: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Affordances“When I say Hypertext, I mean the simultaneous

presentation of information and controls such that the information becomes the affordance through which the user obtains choices and

selects actions.”

Roy Fielding, 2008

Page 18: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Affordances are the reason for hypermedia

Page 19: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

So, what does it look like?

Page 20: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

HTML

https://www.w3.org/History/19921103-hypertext/hypertext/WWW/Link.html

Page 21: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Atom

https://tools.ietf.org/html/rfc4287

Page 22: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

CCXML

https://www.w3.org/TR/ccxml/

Page 23: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

HAL

https://www.w3.org/TR/ccxml/

Page 24: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Siren

https://github.com/kevinswiber/siren

Page 25: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Collection+JSON

http://amundsen.com/media-types/collection/

Page 26: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia Types are the programming language

of the WWW

Page 27: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Messages

Page 28: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Messages are how we communicate

Bill Verplank

Page 29: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Messages are how we manipulate

The Ulm Design School

Page 30: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

We manipulate via affordances

Donald Norman

Page 31: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia affords communication

Page 32: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Patterns for Hypermedia

Page 33: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Architectural Patterns

Christopher Alexander, 1977

Page 34: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Patterns are typically applied to code

Gang of Four, 1994

Page 35: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Applying patterns to messages

Page 36: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Twelve Patterns for Adaptable AppsFour Design PatternsFour Basic PrinciplesFour Shared Agreements

Page 37: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Design Patterns

Page 38: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 39: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Pass Messages, Not Objects"I'm sorry that coined the term 'objects' for this

topic. The big idea is 'messaging'."

Alan Kay, 1998

Page 40: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Pass Messages, Not Objects"I'm sorry that coined the term 'objects' for this

topic. The big idea is 'messaging'."

Alan Kay, 1998

Page 41: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 42: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Pass Messages, Not ObjectsUse a Registered Hypermedia Type

HALCollection+JSONSirenUBERAtom

Page 43: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Pass Messages, not ObjectsWhat problem does this solve?

I don’t need to share your object model to interact with you.

Machines can now manage their own internal models independently.

Page 44: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 45: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Share Vocabularies, Not Models"It is easier to standardize representation and relation types than objects and object-specific

interfaces."-- Roy Fielding

Page 46: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Share Vocabularies, Not Models"It is easier to standardize representation and relation types than objects and object-specific

interfaces."-- Roy Fielding

Page 47: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 48: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Share Vocabularies, Not ModelsUse Existing Shared Vocabularies

IANA Link Relation ValuesSchema.orgMicroformatsDublin CoreActivity Streams

Page 49: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Share Vocabularies, Not ModelsWhat problem does this solve?

Vocabulary is how we “evaluate and select”

Machines can now evaluate and select without direct human interaction.

Page 50: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 51: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use the Representor Pattern"The Strategy Pattern lets the algorithm vary

independently of the clients that use it."- Gamma, et al.

Page 52: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use the Representor PatternImplement a Representor/Strategy Pattern

Standard Internal Resource ModelStrategy Messages Format Dispatch

Page 53: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 54: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use the Representor PatternImplement a Representor/Strategy Pattern

Standard Internal Resource ModelStrategy Messages Format Dispatch

Page 55: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use the Representor PatternImplement a Representor/Strategy Pattern

Standard Internal Resource ModelStrategy Messages Format Dispatch

Page 56: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use the Representor PatternWhat problem does this solve?

Sometimes we need to translate our conversations in order to communicate.

Machines can now “negotiate” the language of a conversation.

Page 57: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 58: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Publish Profiles"Profiles provide a way to create a ubiquitous

language for talking about APIs (resources) for both humans and machines."

-- Mark Foster

Page 59: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Publish ProfilesUse a Profile like ALPS to share vocabularies

Define all possible data and actionsPublish using Profile Standard (RFC6906)Servers emit profile URIClients validate profile URI

Page 60: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 61: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Publish ProfilesUse a Profile like ALPS to share vocabularies

Define all possible data and actionsPublish using Profile Standard (RFC6906)Servers emit profile URIClients validate profile URI

Page 62: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Publish ProfilesUse a Profile like ALPS to share vocabularies

Define all possible data and actionsPublish using Profile Standard (RFC6906)Servers emit profile URIClients validate profile URI

Page 63: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Publish ProfilesWhat problem does this solve?

I need to know what we’re talking about.

Machines can now validate domain topics easily

Page 64: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Basic Principles

Page 65: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 66: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Must Ignore“The main goal of the MUST IGNORE pattern

of extensibility is to allow backwards- and forwards-compatible changes.”

- David Orchard

Page 67: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 68: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Must IgnoreClients MUST IGNORE any data/inputs that the client does not understand.

Page 69: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Must IgnoreWhat problem does this solve?

Ignoring what we don’t understand lets us “do our own thing” w/o knowing everyone’s job

Machines can now focus on their own job, not everyone’s job.

Page 70: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 71: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

MUST FORWARD“A proxy MUST forward unrecognized header

fields…”-- RFC 7230

A proxy MUST forward an unknown header A proxy MUST forward unrecognized header fields

Page 72: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 73: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Must ForwardClients MUST FORWARD (unchanged) any input fields (URL or FORM) that the client does not recognize.

Page 74: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Must ForwardWhat problem does this solve?

We don’t edit for others around us.

Machines can now co-operate w/o full understanding of other’s work

Page 75: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 76: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Provide MRU“A feature of convenience allowing users to

quickly see and access the last few used files and documents.”

-- Wikipedia

Page 77: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 78: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Provide MRUServices SHOULD return the most recently-used (MRU) LINKS and FORMS in all responses.

Page 79: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Provide MRUWhat problem does this solve?

We need most-used tools close at hand

Machines can now find most-used affordances easily

Page 80: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 81: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use Idempotence“Can be applied multiple times without

changing the result beyond the initial application.”-- Wikpedia

Page 82: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 83: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use IdempotenceAll network requests SHOULD be idempotent in order to allow clients to safely repeat them when response is unclear.

Page 84: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use IdempotenceWhat problem does this solve?

If things didn’t work right the first time, we need to try again.

Machines can now safely “try again”

Page 85: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Shared Agreements

Page 86: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 87: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use Related“By watching what you click on in search results, Google can learn that you favor particular sites.” – Danny Sullivan, 2009

Page 88: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 89: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use RelatedServices SHOULD return a RELATED LINK that responds with ALL the possible actions for this context.

Page 90: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use RelatedWhat problem does this solve?

I can’t remember everything, need an easy way to look up instructions.

Machines can now “look up” the available affordances.

Page 91: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 92: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use Navigation“To achieve a single goal which can be broken

down into dependable sub-tasks.”-- Design Patterns (@uipatterns)

Page 93: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 94: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use NavigationServices SHOULD provide "next/previous" LINK to handle multi-step workflow with "cancel", "restart", & "done."

Page 95: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use NavigationWhat problem does this solve?

I can’t keep all the steps in my head

Machines can now navigate through a long series of steps safely.

Page 96: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 97: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Partial Submit“Think of the actions as approximations of what

is desired.”-- Donald Norman

Page 98: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 99: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Partial SubmitServices SHOULD accept partially filled-in FORM and return a new FORM with the remaining fields.

Page 100: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use NavigationWhat problem does this solve?

I sometimes only know part of the story.

Machines can now interact in small parts and not always be perfect.

Page 101: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 102: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

State Watch“Data representing variables in a dynamical

system…”-- Jens Rassmussen

Page 103: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

State Watch“Data representing variables in a dynamical

system…”-- Jens Rassmussen

Page 104: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through
Page 105: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

State WatchServices SHOULD allow clients to subscribe to WATCH VALUES so that clients can deterimine "done."

Page 106: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Use State WatchWhat problem does this solve?

My boss doesn’t always set my goals.

Machines can now set their own goals and act accordingly.

Page 107: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Summary

Page 108: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia is the language of the WWW

Page 109: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia Types are the programming language

of the WWW

Page 110: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Hypermedia affords communication

Page 111: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Apply patterns to messages

Page 112: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Twelve Patterns for Adaptable APIsFour Design PatternsFour Basic PrinciplesFour Shared Agreements

Page 113: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Design Patterns1.PASS MESSAGES, NOT OBJECTS2.SHARE VOCABULARIES, NOT MODELS3.THE REPRESENTOR PATTERN4.PUBLISH PROFILES

Page 114: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Basic Principles5. MUST IGNORE6. MUST FORWARD7. PROVIDE MRU8. USE IDEMPOTENCE

Page 115: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Basic Agreements 9. USE RELATED10. USE NAVIGATION11. PARTIAL SUBMIT12. STATE WATCH

Page 116: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

The Best Software Architecture"The best software architecture 'knows' what

changes often and makes that easy."- Paul Clements

Page 117: Evolvable APIs - amundsen.commamund.com/talks/2017-03-sxsw/2017-03-sxsw-patterns.pdf · presentation of information and controls such that the information becomes the affordance through

Twelve Patterns for Evolvable APIs

Mike AmundsenAPI Academy / CA

@mamund

Drawings by Diogo Lucas@diogoclucas