Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service...
Transcript of Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service...
![Page 1: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/1.jpg)
Twelve Patterns for
Hypermedia Service
ArchitectureMike Amundsen
API Academy / CA
@mamund
Drawings by Diogo Lucas
@diogoclucas
![Page 2: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/2.jpg)
Introduction
![Page 3: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/3.jpg)
![Page 4: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/4.jpg)
![Page 5: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/5.jpg)
![Page 6: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/6.jpg)
![Page 7: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/7.jpg)
Outline
• Hypermedia
• Messages
• Patterns
• 4+4+4
• Summary
![Page 8: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/8.jpg)
Hypermedia
![Page 9: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/9.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/10.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/11.jpg)
What is Hypermedia?
Hypertext and Hypermedia
are concepts, not products.
https://www.w3.org/WhatIs.html
![Page 12: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/12.jpg)
Hypermedia is the
language of the WWW
![Page 13: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/13.jpg)
Why Hypermedia?
![Page 14: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/14.jpg)
Why Hypermedia?
Affordances!
![Page 15: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/15.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/16.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/17.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/18.jpg)
Affordances are the
reason for hypermedia
![Page 19: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/19.jpg)
So, what does it look like?
![Page 20: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/20.jpg)
HTML
https://www.w3.org/History/19921103-hypertext/hypertext/WWW/Link.html
![Page 21: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/21.jpg)
Atom
https://tools.ietf.org/html/rfc4287
![Page 22: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/22.jpg)
CCXML
https://www.w3.org/TR/ccxml/
![Page 23: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/23.jpg)
HAL
https://www.w3.org/TR/ccxml/
![Page 24: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/24.jpg)
Siren
https://github.com/kevinswiber/siren
![Page 25: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/25.jpg)
Collection+JSON
http://amundsen.com/media-types/collection/
![Page 26: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/26.jpg)
Hypermedia Types are the
programming language
of the WWW
![Page 27: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/27.jpg)
Messages
![Page 28: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/28.jpg)
Messages are how we communicate
Bill Verplank
![Page 29: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/29.jpg)
Messages are how we manipulate
The Ulm Desgn School
![Page 30: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/30.jpg)
We manipulate via affordances
Donald Norman
![Page 31: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/31.jpg)
Hypermedia affords communication
![Page 32: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/32.jpg)
Patterns for Hypermedia
![Page 33: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/33.jpg)
Architectural Patterns
Christopher Alexander, 1977
![Page 34: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/34.jpg)
Patterns are typically applied to code
Gang of Four, 1994
![Page 35: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/35.jpg)
Applying patterns to messages
![Page 36: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/36.jpg)
Twelve Patterns for Adaptable Apps
Four Design Patterns
Four Basic Principles
Four Shared Agreements
![Page 37: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/37.jpg)
Design Patterns
![Page 38: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/38.jpg)
![Page 39: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/39.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/40.jpg)
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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/41.jpg)
![Page 42: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/42.jpg)
Pass Messages, Not Objects
Use a Registered Hypermedia Type
HAL
Collection+JSON
Siren
UBER
Atom
![Page 43: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/43.jpg)
Pass Messages, not Objects
What 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: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/44.jpg)
![Page 45: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/45.jpg)
Share Vocabularies, Not Models
"It is easier to standardize representation and
relation types than objects and object-specific
interfaces."
-- Roy Fielding
![Page 46: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/46.jpg)
Share Vocabularies, Not Models
"It is easier to standardize representation and
relation types than objects and object-specific
interfaces."
-- Roy Fielding
![Page 47: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/47.jpg)
![Page 48: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/48.jpg)
Share Vocabularies, Not Models
Use Existing Shared Vocabularies
IANA Link Relation Values
Schema.org
Microformats
Dublin Core
Activity Streams
![Page 49: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/49.jpg)
Share Vocabularies, Not Models
What problem does this solve?
Vocabulary is how we “evaluate and select”
Machines can now
evaluate and select without
direct human interaction.
![Page 50: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/50.jpg)
![Page 51: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/51.jpg)
Use the Representor Pattern
"The Strategy Pattern lets the algorithm vary
independently of the clients that use it."
- Gamma, et al.
![Page 52: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/52.jpg)
Use the Representor Pattern
Implement a Representor/Strategy Pattern
Standard Internal Resource Model
Strategy Messages Format Dispatch
![Page 53: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/53.jpg)
![Page 54: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/54.jpg)
Use the Representor Pattern
Implement a Representor/Strategy Pattern
Standard Internal Resource Model
Strategy Messages Format Dispatch
![Page 55: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/55.jpg)
Use the Representor Pattern
What 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 56: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/56.jpg)
![Page 57: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/57.jpg)
Publish Profiles
"Profiles provide a way to create a ubiquitous
language for talking about APIs (resources) for
both humans and machines."
-- Mark Foster
![Page 58: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/58.jpg)
Publish Profiles
Use a Profile like ALPS to share vocabularies
Define all possible data and actions
Publish using Profile Standard (RFC6906)
Servers emit profile URI
Clients validate profile URI
![Page 59: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/59.jpg)
![Page 60: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/60.jpg)
Publish Profiles
Use a Profile like ALPS to share vocabularies
Define all possible data and actions
Publish using Profile Standard (RFC6906)
Servers emit profile URI
Clients validate profile URI
![Page 61: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/61.jpg)
Publish Profiles
What problem does this solve?
I need to know what we’re talking about.
Machines can now
validate domain topics easily
![Page 62: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/62.jpg)
Basic Principles
![Page 63: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/63.jpg)
![Page 64: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/64.jpg)
Must Ignore
“The main goal of the MUST IGNORE pattern
of extensibility is to allow backwards- and
forwards-compatible changes.”
- David Orchard
![Page 65: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/65.jpg)
![Page 66: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/66.jpg)
Must Ignore
Clients MUST IGNORE any data/inputs that the
client does not understand.
![Page 67: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/67.jpg)
Must Ignore
What 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 68: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/68.jpg)
![Page 69: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/69.jpg)
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 70: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/70.jpg)
![Page 71: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/71.jpg)
Must Forward
Clients MUST FORWARD (unchanged) any
input fields (URL or FORM) that the client does
not recognize.
![Page 72: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/72.jpg)
Must Forward
What 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 73: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/73.jpg)
![Page 74: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/74.jpg)
Provide MRU
“A feature of convenience allowing users to
quickly see and access the last few used files
and documents.”
-- Wikipedia
![Page 75: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/75.jpg)
![Page 76: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/76.jpg)
Provide MRU
Services SHOULD return the most recently-
used (MRU) LINKS and FORMS in all
responses.
![Page 77: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/77.jpg)
Provide MRU
What problem does this solve?
We need most-used tools close at hand
Machines can now find most-used
affordances easily
![Page 78: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/78.jpg)
![Page 79: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/79.jpg)
Use Idempotence
“Can be applied multiple times without
changing the result beyond the initial
application.”
-- Wikpedia
![Page 80: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/80.jpg)
![Page 81: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/81.jpg)
Use Idempotence
All network requests SHOULD be idempotent in
order to allow clients to safely repeat them
when response is unclear.
![Page 82: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/82.jpg)
Use Idempotence
What 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 83: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/83.jpg)
Shared Agreements
![Page 84: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/84.jpg)
![Page 85: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/85.jpg)
Use Related
“By watching what you click on in search
results, Google can learn that you favor
particular sites.” – Danny Sullivan, 2009
![Page 86: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/86.jpg)
![Page 87: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/87.jpg)
Use Related
Services SHOULD return a RELATED LINK
that responds with ALL the possible actions for
this context.
![Page 88: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/88.jpg)
Use Related
What 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 89: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/89.jpg)
![Page 90: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/90.jpg)
Use Navigation
“To achieve a single goal which can be broken
down into dependable sub-tasks.”
-- Design Patterns (@uipatterns)
![Page 91: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/91.jpg)
![Page 92: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/92.jpg)
Use Navigation
Services SHOULD provide "next/previous"
LINK to handle multi-step workflow with
"cancel", "restart", & "done."
![Page 93: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/93.jpg)
Use Navigation
What 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 94: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/94.jpg)
![Page 95: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/95.jpg)
Partial Submit
“Think of the actions as approximations of what
is desired.”
-- Donald Norman
![Page 96: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/96.jpg)
![Page 97: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/97.jpg)
Partial Submit
Services SHOULD accept partially filled-in
FORM and return a new FORM with the
remaining fields.
![Page 98: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/98.jpg)
Use Navigation
What 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 99: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/99.jpg)
![Page 100: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/100.jpg)
State Watch
“Data representing variables in a dynamical
system…”
-- Jens Rassmussen
![Page 101: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/101.jpg)
State Watch
“Data representing variables in a dynamical
system…”
-- Jens Rassmussen
![Page 102: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/102.jpg)
![Page 103: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/103.jpg)
State Watch
Services SHOULD allow clients to subscribe to
WATCH VALUES so that clients can deterimine
"done."
![Page 104: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/104.jpg)
Use State Watch
What problem does this solve?
My boss doesn’t always set my goals.
Machines can now set their own
goals and act accordingly.
![Page 105: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/105.jpg)
Summary
![Page 106: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/106.jpg)
Hypermedia is the
language of the WWW
![Page 107: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/107.jpg)
Hypermedia Types are the
programming language
of the WWW
![Page 108: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/108.jpg)
Hypermedia affords communication
![Page 109: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/109.jpg)
Apply patterns to messages
![Page 110: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/110.jpg)
Twelve Patterns for Adaptable Apps
Four Design Patterns
Four Basic Principles
Four Shared Agreements
![Page 111: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/111.jpg)
Design Patterns
1.PASS MESSAGES, NOT OBJECTS
2.SHARE VOCABULARIES, NOT MODELS
3.THE REPRESENTOR PATTERN
4.PUBLISH PROFILES
![Page 112: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/112.jpg)
Basic Principles
5. MUST IGNORE
6. MUST FORWARD
7. PROVIDE MRU
8. USE IDEMPOTENCE
![Page 113: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/113.jpg)
Basic Agreements
9. USE RELATED
10. USE NAVIGATION
11. PARTIAL SUBMIT
12. STATE WATCH
![Page 114: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/114.jpg)
The Best Software Architecture
"The best software architecture 'knows' what
changes often and makes that easy."
- Paul Clements
![Page 115: Twelve Patterns for Hypermedia Service Architecture€¦ · Twelve Patterns for Hypermedia Service Architecture Mike Amundsen API Academy / CA @mamund Drawings by Diogo Lucas @diogoclucas](https://reader035.fdocuments.in/reader035/viewer/2022070111/605143901512705331603d03/html5/thumbnails/115.jpg)
Twelve Patterns for
Hypermedia Service
ArchitectureMike Amundsen
API Academy / CA
@mamund
Drawings by Diogo Lucas
@diogoclucas