Spring HATEOAS versus Spring Data Rest

前端 未结 3 1377
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 16:39

Question is, what\'s the difference between Spring HATEOAS versus Spring Data Rest ?

I feel both can do the same, and Spring Data Rest (as part of Spring Data) seems

3条回答
  •  萌比男神i
    2020-12-12 17:08

    HATEOAS stand for Hypermedia as the Engine of Application State and is one of the key ponit of REST. Basically the key point consist to use links on the your resource representation for map the valid transition of the application state. In this case will be the service provider that provide the valid next correct state of the your application reachable through the link. Spring HATEOAS is the Spring projects for help to build the Hymeridia Controls in your Resource. It is a project integrate with Spring MVC and you can think as the Spring MVC extension for building a real RESTFull WS whit a very good support for increase the level of the your service form CRUD (level 2 of maturity in the Richardson model) to an Hypermedia aware (level 3 of maturity in the Richardson model). Spring Data Rest on the other hands is a very nice project that use Spring HATEOAS as basic brick, for give you a repository layer usable as restfull ws. In proctis the project help to reduce the classical boliporlent code for expose the your repository layer as a restfull endpoint. We can say tat was the propouse of the projects very different. With Spring HATEOAS you had a framework usable for any kind of restfull endpoint, with spring data rest you had a spring project that already provide an endpoint and a framework for customize it.

    I hope that this reflections can help you to clarify the difference between the two projects and understand better how use one or the other

提交回复
热议问题