HATEOAS(Hypermedia As The Engine of Application State)
HATEOAS란?
- REST application 의 규약- 클라이언트는 선행정보 없이 서버로부터 전송되는 데이터만으로도 인터렉션이 가능해 진다. 기정의된 IDL 인터페이스를 통해 SOA(Service Oriented Architecture)와 대조되는 개념이다.
- client는 어떤 document나 다른 정보 없이 서비스의 하위 정보로 접근이 가능해 지는 이점을 가져갈 수 있다. 기존에 hypertext에서 href를 통해 링크 정보를 내려주는 것과 비슷하다고 볼 수 있다.
Hypermedia는 뭐지?
- Hypertext의 확정향 개념, hypertext는 일반 text에서 문서간 이동이 가능하도록 hyperlink를 제공해 주었는데, 여기에 Hypermedia는 audio, video까지 포함한 개념으로 이해하면 된다.- 참조 : https://en.wikipedia.org/wiki/Hypermedia
Examples
{
"content": [ {
"price": 499.00,
"description": "Apple tablet device",
"name": "iPad",
"links": [ {
"rel": "self",
"href": "http://localhost:8080/product/1"
} ],
"attributes": {
"connector": "socket"
}
}, {
"price": 49.00,
"description": "Dock for iPhone/iPad",
"name": "Dock",
"links": [ {
"rel": "self",
"href": "http://localhost:8080/product/3"
} ],
"attributes": {
"connector": "plug"
}
} ],
"links": [ {
"rel": "product.search",
"href": "http://localhost:8080/product/search"
} ]
}
(spring site에서 참조)Spring에서는?
- REST Protocol 기반에서 HATEOAS를 지원하기 위한 라이브러리 제공=> LinkBuilder나Annotation등을 제공
=> 링크 : http://projects.spring.io/spring-hateoas/
- Hypermedia를 기반으로 RESTful 서비스를 만드는 가이드 제공
=> Spring 프레임웍을 통해 쉽고 빠르게 RESTful 서비스를 만들 수 있는 가이드
=> 링크 : https://spring.io/guides/gs/rest-hateoas/
다음 youtube 동영상을 통해서도 HATEOAS에 설명을 들을 수 있음.
답글삭제https://www.youtube.com/watch?v=NK3HNEwDXUk