Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Hypermedia-Driven RESTful APIs
Search
Christoph Strobl
May 25, 2016
Programming
79
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hypermedia-Driven RESTful APIs
Christoph Strobl
May 25, 2016
More Decks by Christoph Strobl
See All by Christoph Strobl
Beyond the Magic - Spring Data AOT Repositories
christophstrobl
1
33
Beyond the Magic - Spring Data Ahead of Time Repositories for MongoDB
christophstrobl
0
28
MongoDB for Java Developers: The Ultimate Spring Data MongoDB Starter Kit
christophstrobl
1
120
Spring Data Cookbook
christophstrobl
2
590
No Offset - Pagination with the Seek Method
christophstrobl
0
200
Tech Talk - Persistence with Spring Data
christophstrobl
0
320
A Spring Data’s Guide to Persistence
christophstrobl
0
150
What's new in Spring Data MongoDB
christophstrobl
0
230
Spring Data Moore and Beyond
christophstrobl
0
830
Other Decks in Programming
See All in Programming
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
290
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.3k
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
290
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
100
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
570
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
830
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
340
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
200
Android CLI
fornewid
0
190
数百円から始めるRuby電子工作
tarosay
0
120
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
140
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Thoughts on Productivity
jonyablonski
76
5.3k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
We Have a Design System, Now What?
morganepeng
55
8.2k
Automating Front-end Workflow
addyosmani
1370
210k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
230
Transcript
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > Hypermedia-Driven RESTful APIs > Christoph Strobl | @stroblchristoph > Pivotal Software, Inc.
2
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > REST?
4 POST = Create, GET = Read,… Client-Server, Stateless, Cacheable
> Representational State Transfer > uses: HTTP for CRUD > requires: Architecture Constraints Uniform Interface
5 image source: http://petstore.swagger.io
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > Hypermedia?
Hypermedia Presentation of data and navigation controls! at the same
time
HATEOAS 8 Media Types describe resources. Actions are executed by
following links. Response reflects state. Clients explore the API. Hypermedia as the Engine of Application State
HAL 9 Resource Links Embedded Resource State Name Target Hypertext
Application Language
ALPS 10 Closes the gap between! ! state and transition.
Descriptors semantic data safe GET unsafe POST idempotent PUT/DELTE Application Level Profile Semantics
JSON Schema 11 Describes your JSON data
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ > > Demo?
Spring Data REST 13 @SpringBootApplication public class StoreApp { !
public static void main(String[] args) { SpringApplication.run(StoreApp.class, args); } ! interface StoreRepository extends PagingAndSortingRepository<Store, String> { ! ! } } Page<Store> findByAddressLocationNear(Point location, Distance distance, Pageable pageable); @RestResource(rel = "by-location") <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId>
14 Repository Resource Relation Link IDs URIs @Version ETags @LastModified
Date Last-Modified What it does
Let’s try this local… 15 <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> >
mvn clean spring-boot:run
None
I am completely operational.! ! All my circuits ! are
functioning perfectly. Thank you! image source: HAL 9000 - Space Odyssey wallpaper http://www.wallconvert.com/
Resources (alphabetical) § alps.io/spec/ § json-schema.org § projects.spring.io/spring-boot § projects.spring.io/spring-data
§ stateless.co/hal_specification § swagger.io 18