`

推荐一个老外的spring HATEOAS的demo

阅读更多
  今天遇到个新词,spring  HATEOAS,一看就知道是spring支持的项目,再查询下
居然 HATEOAS这个词是跟REST有关系的,但可惜中文资料少,只能找到英文的资料:

http://en.wikipedia.org/wiki/HATEOAS

HATEOAS, an abbreviation for Hypermedia as the Engine of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures. The principle is that a client interacts with a network application entirely through hypermedia provided dynamically by application servers. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. Contrast this with e.g. a service-oriented architecture (SOA), where clients and servers interact through a fixed interface shared through documentation or an interface description language (IDL).
The HATEOAS constraint serves to decouple client and server in a way that allows the server to evolve functionality independently.

超媒体即引用状态引擎(Hypermedia As The Engine Of Application State,缩写为HATEOAS)

找了下,一个不错的中文简介见这个连接:
http://www.cnblogs.com/tyb1222/archive/2011/12/13/2286621.html

而这个老外
http://blog.codecentric.de/en/2013/01/a-real-roca-using-bootstrap-jquery-thymeleaf-spring-hateoas-and-spring-mvc/

则使用bootstrap,jquery,thymleaf,spring hateoas springmvc实现了一个DEMO,
具体代码可以在:
https://github.com/tobiasflohre/movie-database
下载
2
4
分享到:
评论
4 楼 wuxian_Abs2 2013-03-08  
我看了movie-database的例子,觉得HATEOAS的使用还是让我有些迷惑:
movie对象包裹在Resource里,可以通过它拿到操作movie对象的所有uri,模板页面上也没了写死的uri。但页面上还是知道当前movie可以做的所有操作,并列出了按钮。
假如一个人有权限做edit操作,有一个人没有权限,那这个控制最后还是得在页面上去判断,不是吗?
这和HATEOAS要达到的效果还是不一样,HATEOAS是返回数据的同时返回当前状态下能做的操作的链接,页面上并不能完全确定当前状态哪些操作可用。
3 楼 逆风翔 2013-02-18  
头像很基情 
2 楼 duanxianling 2013-02-18  
678677777777777768678
1 楼 char1st 2013-02-18  
https://github.com/SpringSource/spring-data-rest/wiki/JPA-Repository-REST-Exporter


....

相关推荐

Global site tag (gtag.js) - Google Analytics