Spring5学习(二)-spring projects之Spring HATEOAS

来源:互联网 发布:一分钱图片淘宝怎么弄 编辑:程序博客网 时间:2024/06/05 06:35

Spring HATEOAS

Create REST representations that follow the HATEOAS principle from your Spring-based applications.(根据基于Spring的应用程序的HATEOAS原则创建的REST表现形式)




Spring HATEOAS provides some APIs to ease(缓解) creating REST representations that follow the HATEOAS principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly.




Features

  • Model classes for link, resource representation models
  • Link builder API to create links pointing to Spring MVC controller methods
  • Support for hypermedia(超媒体) formats like HAL





说明:
1. HAL:Hyperspace Analogue to Language (HAL)也被称为语义存储模型(semantic memory),由University of California, Riverside, California的Kevin Lund 和Curt Burgress于1996年提出的。Hyperspace Analogue to Language (HAL)模型的前提是,意义相近的词总是反复共同出现(也称为co-occurrence)。(参考:百度百科,另一种解释)

2. HATEOAS:Hypermedia As The Engine Of Application State (HATEOAS) is a constraint of the REST application architecture that distinguishes it from other network application architectures.(来自:wikipedia);HATEOAS(Hypermedia as the engine of application state)是 REST 架构风格中最复杂的约束,也是构建成熟 REST 服务的核心。它的重要性在于打破了客户端和服务器之间严格的契约,使得客户端可以更加智能和自适应,而 REST 服务本身的演化和更新也变得更加容易。(来自:IBM);HATEOAS(The Hypermedia As The Engine Of Application Statue)是REST架构的主要约束。“hepermedia”表示任何包含指向图片、电影、文字等资源的链接,Web是超媒体的经典例子。HATEOAS背后的思想其实非常简单,就是响应中包含指向其它资源的链接。客户端可以利用这些链接和服务器交互。(来自:博客园)


阅读全文
0 0