百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

the-spring-rest-stack

> 编程语言
开源

我的演讲主题是如何构建更强大的 REST API

372 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

我的演讲主题是如何构建更强大的 REST API

The Spring REST Stack

This code accompanies a talk that I deliver on RESTful service development with Spring.

  • There are online versions of the talk. Notably, I presented it as a webinar on the SpringSourceDev channel.
  • See the slides on my SlideShare.net page.
  • This code lives at [my GitHub page (joshlong) for this project the-spring-rest-stack](http://github.com/joshlong/the-spring-rest-stack/code).

The goals of this project are to demonstrate the development of a simple REST service with Spring. The REST service concerns itself with the domain of a simple CRM: a user manages a customer collection.

Breakdown of the Various Tiers

The Data and Service Tier

The data tier module services uses Spring Data JPA repositories, a standard SQL database, and Spring's standard transaction management infrastructure to build a service. This tier is configured by importing the class com.jl.crm.services.ServiceConfiguration. Currently there are two Spring profiles. One called production, which attempts to the SQL database configured in /code/services/src/main/resources/config.properties, and test, which manages an embedded H2 database which can be accessed at the embedded H2 database console web application with the configuration shown below.

The REST Tier

There are four web-tier modules, rest, hateoas, hateoas-data, and oauth, which demonstrate the evolution of a REST service implemented using Spring MVC to manage users and customers. The initial cut, rest, is fairly RESTful, but not HATEOAS and hypermedia compliant. The next cut, hateoas uses Spring HATEOAS to introduce hypermedia. This improvement, while welcome, is not without an associated cost in code. The next cut, hateoas-data, introduces [Spring Data REST](https://github.com/SpringSource/Spring-Data-REST) which reduces boilerplate code associated with managing data from the REST endpoint to the database. In the final cut, oauth, we introduce Spring Security and Spring Security OAuth to secure the API's from both prying eyes and unauthorized application clients.

The Client Tier

The social module is a Spring Social API binding for the OAuth 2.0-secured CRM REST API. The ClientExample demonstrates how to configure and use the Spring Social binding outside of a web container and demonstrates some of its uses.

The android module is a Spring Android-powered Android client that embeds the social client and uses it to support an Android mobile application.

Notes on Implementation

For a detailed walkthrough of all the code, please check out the tutorial.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言