Enviar búsqueda
Cargar
REST и HATEOAS
•
5 recomendaciones
•
1,466 vistas
Artem Bey
Seguir
Доклад об уровнях REST и принципе HATEOAS на KharkivJS 7 ноября 2015
Leer menos
Leer más
Software
Denunciar
Compartir
Denunciar
Compartir
1 de 48
Descargar ahora
Descargar para leer sin conexión
Recomendados
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...
Magneta AI
"Создание системы логирования" Литуненко Андрей, 2ГИС
"Создание системы логирования" Литуненко Андрей, 2ГИС
it-people
"Гибридное приложение: полгода после релиза" Легчилин Андрей, Парадеев Роман,...
"Гибридное приложение: полгода после релиза" Легчилин Андрей, Парадеев Роман,...
it-people
Spring Boot Ripper
Spring Boot Ripper
Кирилл Толкачёв
CSRF-уязвимости все еще актуальны: как атакующие обходят CSRF-защиту в вашем ...
CSRF-уязвимости все еще актуальны: как атакующие обходят CSRF-защиту в вашем ...
Mikhail Egorov
PT MIFI Labxss
PT MIFI Labxss
Dmitry Evteev
API-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project Winterfell
Keith McFarlane
API Services: Building Apps That Stand Out
API Services: Building Apps That Stand Out
Apigee | Google Cloud
Recomendados
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...
Magneta AI
"Создание системы логирования" Литуненко Андрей, 2ГИС
"Создание системы логирования" Литуненко Андрей, 2ГИС
it-people
"Гибридное приложение: полгода после релиза" Легчилин Андрей, Парадеев Роман,...
"Гибридное приложение: полгода после релиза" Легчилин Андрей, Парадеев Роман,...
it-people
Spring Boot Ripper
Spring Boot Ripper
Кирилл Толкачёв
CSRF-уязвимости все еще актуальны: как атакующие обходят CSRF-защиту в вашем ...
CSRF-уязвимости все еще актуальны: как атакующие обходят CSRF-защиту в вашем ...
Mikhail Egorov
PT MIFI Labxss
PT MIFI Labxss
Dmitry Evteev
API-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project Winterfell
Keith McFarlane
API Services: Building Apps That Stand Out
API Services: Building Apps That Stand Out
Apigee | Google Cloud
Securing RESTful services with Spring HATEOAS & Hdiv
Securing RESTful services with Spring HATEOAS & Hdiv
Hdiv Security
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
VMware Tanzu
Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)
MitinPavel
HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization
HCL Technologies
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud
Alexander SAMARIN
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris Lukassen
Avisi B.V.
Apiworld
Apiworld
Owen Rubel
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case study
OSSCube
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API Architecture
Twilio Inc
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL Meetup
Rolph Haspers
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers
WSO2
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project
ILM Professional Services
IO State In Distributed API Architecture
IO State In Distributed API Architecture
Owen Rubel
Api Abstraction & Api Chaining
Api Abstraction & Api Chaining
Owen Rubel
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
kumar gaurav
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The Essentials
C4Media
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
Colin Bell
Building an API Platform for Digital Transformation
Building an API Platform for Digital Transformation
WSO2
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9
Bruce Schonk -PMP, MBA
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
Renaud Visage
!2hl++2008 Restful Architechture
!2hl++2008 Restful Architechture
Ontico
RESTful Architechture (Highload++ 2008)
RESTful Architechture (Highload++ 2008)
Sergey Skvortsov
Más contenido relacionado
Destacado
Securing RESTful services with Spring HATEOAS & Hdiv
Securing RESTful services with Spring HATEOAS & Hdiv
Hdiv Security
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
VMware Tanzu
Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)
MitinPavel
HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization
HCL Technologies
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud
Alexander SAMARIN
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris Lukassen
Avisi B.V.
Apiworld
Apiworld
Owen Rubel
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case study
OSSCube
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API Architecture
Twilio Inc
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL Meetup
Rolph Haspers
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers
WSO2
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project
ILM Professional Services
IO State In Distributed API Architecture
IO State In Distributed API Architecture
Owen Rubel
Api Abstraction & Api Chaining
Api Abstraction & Api Chaining
Owen Rubel
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
kumar gaurav
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The Essentials
C4Media
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
Colin Bell
Building an API Platform for Digital Transformation
Building an API Platform for Digital Transformation
WSO2
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9
Bruce Schonk -PMP, MBA
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
Renaud Visage
Destacado
(20)
Securing RESTful services with Spring HATEOAS & Hdiv
Securing RESTful services with Spring HATEOAS & Hdiv
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Modernizing the Legacy - How Dish is Adapting its SOA Services for a Cloud Fi...
Hypermedia api (HATEOAS)
Hypermedia api (HATEOAS)
HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris Lukassen
Apiworld
Apiworld
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case study
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API Architecture
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL Meetup
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project
IO State In Distributed API Architecture
IO State In Distributed API Architecture
Api Abstraction & Api Chaining
Api Abstraction & Api Chaining
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The Essentials
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
Building an API Platform for Digital Transformation
Building an API Platform for Digital Transformation
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture at Eventbrite - Presente...
Similar a REST и HATEOAS
!2hl++2008 Restful Architechture
!2hl++2008 Restful Architechture
Ontico
RESTful Architechture (Highload++ 2008)
RESTful Architechture (Highload++ 2008)
Sergey Skvortsov
Database (Lecture 14 – database)
Database (Lecture 14 – database)
Noveo
Встреча №8. RESTful клиент — это просто. Тонкости использования RestKit, Миха...
Встреча №8. RESTful клиент — это просто. Тонкости использования RestKit, Миха...
CocoaHeads
Консервативный Backend на Node.js / Дмитрий Ляпин (Recrumatic)
Консервативный Backend на Node.js / Дмитрий Ляпин (Recrumatic)
Ontico
Stas Sultanov "REST again? Oh, come on!"
Stas Sultanov "REST again? Oh, come on!"
Fwdays
Примеры быстрой разработки API на масштабируемом сервере приложений Impress д...
Примеры быстрой разработки API на масштабируемом сервере приложений Impress д...
Timur Shemsedinov
Web осень 2012 лекция 4
Web осень 2012 лекция 4
Technopark
Node.JS: возможности для РНР-разработчика
Node.JS: возможности для РНР-разработчика
Alexei Smolyanov
Взломать Web-сайт на ASP.NET? Сложно, но можно!
Взломать Web-сайт на ASP.NET? Сложно, но можно!
Vladimir Kochetkov
Alexander manuhin selenium_php_v2.0
Alexander manuhin selenium_php_v2.0
matroskin1980
React со скоростью света: не совсем обычный серверный рендеринг
React со скоростью света: не совсем обычный серверный рендеринг
Timophy Chaptykov
Web and mobile development for intersystems caché, Eduard Lebedyuk
Web and mobile development for intersystems caché, Eduard Lebedyuk
InterSystems
Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)
Noveo
МАИ, Сети ЭВМ, Лекция №7
МАИ, Сети ЭВМ, Лекция №7
Dima Dzuba
Building corporate portals with liferay JEEConf 2011
Building corporate portals with liferay JEEConf 2011
Alexey Kakunin
.NET Fest 2018. Сергей Калинец. Azure веб разработка здорового человека
.NET Fest 2018. Сергей Калинец. Azure веб разработка здорового человека
NETFest
Программируемость корпоративной сети с Cisco APIC-EM
Программируемость корпоративной сети с Cisco APIC-EM
Cisco Russia
Mihail davidov js-ajax
Mihail davidov js-ajax
Yandex
Михаил Давыдов — Транспорт, Ajax
Михаил Давыдов — Транспорт, Ajax
Yandex
Similar a REST и HATEOAS
(20)
!2hl++2008 Restful Architechture
!2hl++2008 Restful Architechture
RESTful Architechture (Highload++ 2008)
RESTful Architechture (Highload++ 2008)
Database (Lecture 14 – database)
Database (Lecture 14 – database)
Встреча №8. RESTful клиент — это просто. Тонкости использования RestKit, Миха...
Встреча №8. RESTful клиент — это просто. Тонкости использования RestKit, Миха...
Консервативный Backend на Node.js / Дмитрий Ляпин (Recrumatic)
Консервативный Backend на Node.js / Дмитрий Ляпин (Recrumatic)
Stas Sultanov "REST again? Oh, come on!"
Stas Sultanov "REST again? Oh, come on!"
Примеры быстрой разработки API на масштабируемом сервере приложений Impress д...
Примеры быстрой разработки API на масштабируемом сервере приложений Impress д...
Web осень 2012 лекция 4
Web осень 2012 лекция 4
Node.JS: возможности для РНР-разработчика
Node.JS: возможности для РНР-разработчика
Взломать Web-сайт на ASP.NET? Сложно, но можно!
Взломать Web-сайт на ASP.NET? Сложно, но можно!
Alexander manuhin selenium_php_v2.0
Alexander manuhin selenium_php_v2.0
React со скоростью света: не совсем обычный серверный рендеринг
React со скоростью света: не совсем обычный серверный рендеринг
Web and mobile development for intersystems caché, Eduard Lebedyuk
Web and mobile development for intersystems caché, Eduard Lebedyuk
Работа с соцсетями (Lecture 19 – social)
Работа с соцсетями (Lecture 19 – social)
МАИ, Сети ЭВМ, Лекция №7
МАИ, Сети ЭВМ, Лекция №7
Building corporate portals with liferay JEEConf 2011
Building corporate portals with liferay JEEConf 2011
.NET Fest 2018. Сергей Калинец. Azure веб разработка здорового человека
.NET Fest 2018. Сергей Калинец. Azure веб разработка здорового человека
Программируемость корпоративной сети с Cisco APIC-EM
Программируемость корпоративной сети с Cisco APIC-EM
Mihail davidov js-ajax
Mihail davidov js-ajax
Михаил Давыдов — Транспорт, Ajax
Михаил Давыдов — Транспорт, Ajax
REST и HATEOAS
1.
REST и HATEOAS 1
2.
REST и HATEOAS 2 Доклад
не из будущего
3.
Артём Бей @defly_self Fullstack dev
в Trinity Mirror 3
4.
REST != HTTP
5.
Representational State Transfer "Architectural
Styles and the Design of Network-based Software Architectures” Roy Fielding 5
6.
REST — это
архитектурный стиль для распределенных гипермедиа систем. 6
7.
Ресурс http://…/resource <xml> <entity/> </xml> { entity: {…} } 7
8.
http://…/resource <xml> <entity/> </xml> { entity: {…} } представление представление ресурс идентификатор документ картинка процесс … 8
9.
Richardson Maturity Model 9
10.
REST уровня 0 POST /api { "do": "createOrder", "params": { "count": 2 } } POST /api { "do": "cancelOrder", "params": { "id": "34xzfha834flksd34" } } 200 OK { "success": true, "res": { "id": "f239sdk237sdf438" } } 200 OK { "success": false, "error": { "code": 666, "message": "because fk u thats why" } } /api 10
11.
REST уровня 1 POST /users {…} 200 OK { "success": true, "res": { "id": "f239sdk237sdf438" } } 200 OK { "success": false, "error": { "code": 40000, "message": "today is a bad day" } } /users POST /users/1 {…} POST /orders {…} /users/1 /orders 11
12.
Tesla Model S использует REST Level 1
13.
REST уровня 2 13
14.
REST уровня 2 Используем
HTTP по спецификации 14
15.
Методы GET POST PUT DELETE OPTIONS HEAD PATCH … 15
16.
16
17.
200 OK { "success": false, "error": { "code": 666, "message": "because fk u thats why" } 17
18.
400 Bad Request 401 Unauthorized 404 Not Found 402 Payment Required 409 Conflict … 18
19.
418 I’m a
teapot 19
20.
21.
22.
Forbidden Authorization: Bearer ToKeN @wice_
23.
/users /orders /profile … GET POST PUT DELETE OPTIONS HEAD PATCH … 200 201 … 300 301 … 400 401 … 500 501 … покроет все ваши
кейсы 23
24.
REST уровень 3 24
25.
Гипертекст 25
26.
HATEOAS Hypermedia As The
Engine Of Application State 26
27.
представление ресурса = данные + контролы 27
28.
GET /feed 200 OK { "data": [ { "title": "...", "links": { "details": "http://..." } }, .... ], "links": { "self": "http://...", "first": "http://...", "prev": "http://...", "next": "http://...", "last": "http://..." } } 28
29.
GET /feed?min_id=100500 200 OK { "data": [ { "title": "...", "links": { "details": “http://..." } }, .... ], "links": { "self": "http://...", "first": "http://...", "prev": "http://...", "next": "http://...", "last": "http://..." } } 29
30.
GET /films/themartian 200 OK { "data": { "title": "Марсианин", "description": "Как Мэт Дэймон выращивал картошку на Марсе", "duration": 140, "poster": "https://s3.amazon.com/buckets/23aGd23asdsf.png" }, "links": { "self": “http://.../themartian”, "booking": “http://.../themartian/bookings" } } 30
31.
GET /films/themartian 200 OK { "data": { "title": "Марсианин", "description": "Как Мэт Дэймон выращивал картошку на Марсе", "duration": 140, "poster": "https://s3.amazon.com/buckets/23aGd23asdsf.png" }, "links": { "self": “http://.../themartian”, "booking": “http://.../themartian/bookings" } } OPTIONS /films/themartian/bookings 204 No Content Allow: HEAD,GET,POST,OPTIONS 31
32.
POST /films/themartian/bookings { count: 3 } 201 Created Location: http://..../bookings/1 32
33.
GET /films/themartian/bookings/1 200 OK { "data": { "count": 3, "date": "Tue Nov 03 2015 21:45:55 GMT+0200 (EET)", "status": "waiting" }, "links": { "self": "http://..../bookings/1", "cancel": "http://..../bookings/1/cancel", "pay": "http://.../bookings/1/pay" } } 33
34.
Стейт-машина Переходим в новые
состояния по ссылке 34
35.
Некоторые приёмы • Безопасные
и идемпотентные операции • Кеширование неизменяемых ресурсов • X- заголовки • Вендорные типы данных ( application/vnd.myapi.basket.v1+json ) 35
36.
В чём профит? 36
37.
Делаем клиент тоньше,
не нужно больше хачить URL
38.
Распределённые приложения
39.
API могут использовать
роботы
40.
Самодокументирование
41.
Developer Experience
42.
Вопросы к HATEOAS 42
43.
В JSON нет
ссылок и форм. Есть спецификации: HAL, Siren, json:api 43
44.
Нужна ли теперь документация? Нужна.
REST для машин. 44
45.
Слишком академично или много
лишнего. Не нужно реализовывать спецификации в полном объёме. 45
46.
А Twitter, Facebook,
… не применяют HATEOAS. Run-time vs Design-time 46
47.
Почитать • https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm • http://roy.gbiv.com/untangled/2008/rest-apis-must-be- hypertext-driven •
http://martinfowler.com/articles/richardsonMaturityModel.html • REST in Practice by Jim Webber, Savas Parastatidis, and Ian Robinson • http://www.jeffknupp.com/blog/2014/06/03/why-i-hate-hateoas • http://timelessrepo.com/haters-gonna-hateoas
48.
Спасибо, задавайте вопросы! 48
Descargar ahora