Download - Hateoas APIs are about relationships
![Page 1: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/1.jpg)
HATEOAS APISMatt Bishop, Product Architect at Elastic Path
@MattBishopL3
![Page 3: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/3.jpg)
Actually, it’s more like 14,000
1 minute per API = 6 weeks end-to-end
www.elasticpath.com @MattBishopL3
![Page 6: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/6.jpg)
What happened in the 90s?
1989 HTML invented (thanks Tim!) 1992 First browsers built 1994 Netscape launched 1995 Internet Explorer in Win95, IIS
bundled in NT, Apache, PHP released
www.elasticpath.com @MattBishopL3
![Page 8: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/8.jpg)
Make a Website, 1995-style
Web sites were coded in:• Java• C / C++• Perl• ColdFusion• Python
www.elasticpath.com @MattBishopL3
![Page 9: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/9.jpg)
Templates Blew the Doors off the Internet
Late 90s Microsoft ASP, Apache JSP, DreamWeaver, Velocity, etc.
Templates opened internet development to the common man
Templates made data BROWSABLE
www.elasticpath.com @MattBishopL3
![Page 10: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/10.jpg)
Templates made data browsable
Made linking easy <asp:HyperLink … <a href=“<%= getLink
(somedata) %>
Easy linking means easy browsability
Drives the Network Effect
www.elasticpath.com @MattBishopL3
![Page 11: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/11.jpg)
APIs are stuck in the 80s
…1987, to be exact (28,174 hosts)
APIs must be browsable before they can be adopted by 100m organizations
100m organizations == your sister’s dress store, my mom’s knitting club
www.elasticpath.com @MattBishopL3
![Page 12: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/12.jpg)
Comfortably Numb
We can stay stuck here if we don’t link our resources together
www.elasticpath.com @MattBishopL3
![Page 13: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/13.jpg)
Links are about Relationships Relationships are hard
www.elasticpath.com @MattBishopL3
![Page 14: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/14.jpg)
![Page 15: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/15.jpg)
![Page 16: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/16.jpg)
Relationships are not hard after all
• Relationships are a fundamental part of being an animal
www.elasticpath.com @MattBishopL3
![Page 17: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/17.jpg)
Relationships make Versionless APIs possible
Relationships are very stable The resources themselves move, but
their relationships do not GET /profiles/id• “addresses”: “/profiles/id/addresses”
? Hmm maybe addresses should be their own resource ?GET /profiles/id• “addresses”: “/addresses”
www.elasticpath.com @MattBishopL3
![Page 18: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/18.jpg)
Relationships make APIs browsable
Browsable APIs == Browsable data == mass adoption
First step is to make it easy to link
www.elasticpath.com @MattBishopL3
![Page 19: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/19.jpg)
Cortex API Engine
Elastic Path’s API endeavors have failed four times 2010 drank the HATEOAS Kool-Aid, reset our API
effort Found no frameworks to help past URI-to-method
mapping and ser/deser We built an engine using some existing
technology (Jax-RS, Spring, Shiro) and our own work
Cortex is an API engine that happens to run commerce
www.elasticpath.com @MattBishopL3
![Page 20: Hateoas APIs are about relationships](https://reader035.vdocument.in/reader035/viewer/2022081720/547d61b0b4af9f73428b4a19/html5/thumbnails/20.jpg)
Cortex Design Philosophy
• Small, simple resources written by BAs• Small, simple state changes via controls
• Form• Selector
• “Secret Admirer” rule• All Operations are identified
• REST is the Gestalt, HTTP is a transport
www.elasticpath.com @MattBishopL3