Using a Representer
doc.links.hasRel('item');
doc.links.getByRel('item').first();
Decoupled from structure, syntax, and format.
Slide 18
Slide 18 text
Using a Representer
doc.links.add('item', 'http://example.com/1');
doc.links.add('item', 'http://example.com/2');
Decoupled from hypermedia formats. Easy to test what your model
is independent of formats.
Slide 19
Slide 19 text
Connascence of Type (CoT)
Slide 20
Slide 20 text
Instead of JSON -> Applica6on Logic
Use JSON -> Representer -> Applica5on Logic
Slide 21
Slide 21 text
This provides a clearer boundary between
your applica5on and the outside world
Slide 22
Slide 22 text
Your data model is not your object
model is not your resource model is
not your message model.
— Mike Amundsen
Slide 23
Slide 23 text
Real world example
GraphQL has an AST. OpenAPI does not.
Slide 24
Slide 24 text
Takeaways
• Define boundaries
• We shouldn't have breaking changes—clients should just degrade
• Consider inputs/outputs as languages
• Think about canonical structures for crea?ng unity in a world of
diversity