SpringOne2GX 2013 是 Pivotal(现为 VMware Tanzu)主办的年度 Spring 技术大会,2013 年的会议中,Oliver Gierke 和 Greg Turnquist 演示了 Spring RESTBucks —— 一个基于 Spring Framework 构建的、严格遵循 REST 原则(尤其是 HATEOAS)的超媒体驱动(hypermedia-driven)RESTful Web 服务示例项目。
该项目以咖啡店订单系统(类似 Starbucks)为业务场景,完整展示了:
Order, Payment, Item)与超链接(Link)的集成;_links 字段动态提供状态转移能力(如 self, pay, cancel, items 等);Spring RESTBucks 不仅是教学范例,更体现了 Spring 团队对成熟 REST 实践(Roy Fielding 风格)的倡导:客户端不硬编码 URI,而是通过服务端提供的链接进行导航,从而实现松耦合与演进式 API 设计。
该项目源码曾托管于 GitHub(spring-projects/spring-restbucks),后因维护整合逐步归档;其设计理念深刻影响了后续 Spring Data REST、Spring HATEOAS 的演进及 Spring Boot 的默认 REST 风格支持。
SpringOne2GX 2013 replay: Spring RESTBucks - A hypermedia-driven REST webservice
Recorded at SpringOne2GX 2013 in Santa Clara, CA.
Speaker: Oliver Gierke
Spring MVC forms a solid foundation to implement REST based web-services in Java. However, in real-world projects developers still face challenges when it comes to advanced questions of REST. How to really leverage hypermedia? How to model more complex business functionality with REST. The talk introduces the Spring RESTBucks sample implementation of a hypermedia-driven REST web service and explains how it is using hypermedia elements to implement business processes and how Spring technologies (Spring Data REST, Spring Data JPA and Spring HATEOAS) help developers building the system. Learn more about REST at http://projects.spring.io/spring-framework/ (spring MVC’s REST controller) http://projects.spring.io/spring-hateoas/ (Hypermedia Support)

原文作者:Bol5261;如有侵权,请联系管理员删除。