INS-5656 Building simple CRUD services with Spring Data REST | Devoxx

Devoxx Poland 2019
from Monday 24 June to Wednesday 26 June 2019.

   Building simple CRUD services with Spring Data REST

Tools-in-Action

Modern Web
Modern Web
Intermediate level
Room 3 Tuesday from 18:10 til 18:35

Imagine you want to build a simple web service, providing an API for CRUD (Create, Read, Update, Delete) operations. You need to

  • connect to databases
  • create database-specific queries
  • build query statements
  • create controllers
  • analyse results sets

You see, that's a lot of boilerplate. Using Spring Boot and Spring Data helps you reducing this boilerplate. You don't need to care on database connections and queries anymore and use Spring Data repositories instead of query statements. The auditing feature helps to keep consistency.

With Spring Data REST you can even do more. It uses a Domain-class centric approach to repository interactions. You only need to define what's really important - the domain classes. Domains created with Spring Data REST generate controllers and their dependencies. On top you get HATEOAS links you need to walk through your data.

Key Learnings

  • comparison of a handwritten REST service and a Spring Data REST service
  • use ApplicationListeners, e.g. to do some more specific validations
  • how to use HTTP verbs GET, PUT, POST, PATCH and DELETE
REST API   simplicity   Spring Framework   Spring Data REST  
Subscribe to Devoxx on YouTube
Andreas Bräu
Andreas Bräu
From idealo internet GmbH

I studied computer science in Jena, specialized to databases and information systems. During my studies I started working at the University Hospital Jena at the Service Management Department with a focus on hardware rollouts and software deployments. 6 years ago I got back to software development. These days I'm developing services with Spring Boot, messaging systems and a lot of DevOps tasks.

I'm also active member of the freifunk.net community. Here I maintain websites and services. I'm a developer of tools that help local communities to grow and connect to other communities.


Sign-in
Make sure to download the Android or iOS mobile schedule.