Building a RESTful Web Service with Spring

A hands-on guide to building an enterprise-grade, scalable RESTful web service using the Spring Framework
Preview in Mapt

Building a RESTful Web Service with Spring

Ludovic Dewailly

1 customer reviews
A hands-on guide to building an enterprise-grade, scalable RESTful web service using the Spring Framework
Mapt Subscription
FREE
$29.99/m after trial
eBook
$16.80
RRP $23.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$16.80
$29.99
$29.99p/m after trial
RRP $23.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Building a RESTful Web Service with Spring Book Cover
Building a RESTful Web Service with Spring
$ 23.99
$ 16.80
Building a Web Application with Spring and Angular [Video] Book Cover
Building a Web Application with Spring and Angular [Video]
$ 124.99
$ 106.25
Buy 2 for $34.30
Save $114.68
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785285714
Paperback128 pages

Book Description

REST is an architectural style that tackles the challenges of building scalable web services. In today’s connected world, APIs have taken a central role on the web. APIs provide the fabric through which systems interact, and REST has become synonymous with APIs.

The depth, breadth, and ease of use of Spring makes it one of the most attractive frameworks in the Java ecosystem. Marrying the two technologies is therefore a very natural choice.

This book takes you through the design of RESTful web services and leverages the Spring Framework to implement these services. Starting from the basics of the philosophy behind REST, you’ll go through the steps of designing and implementing an enterprise-grade RESTful web service. Taking a practical approach, each chapter provides code samples that you can apply to your own circumstances.

This book goes beyond the use of Spring and explores approaches to tackle resilience, security, and scalability concerns. You’ll learn techniques to deal with security in Spring and discover how to implement unit and integration test strategies.

Finally, the book ends by walking you through building a Java client for your RESTful web service, along with some scaling techniques for it.

Table of Contents

Chapter 1: A Few Basics
REST principles
The Spring Framework and REST
Our RESTful web service
Summary
Chapter 2: Building RESTful Web Services with Maven and Gradle
Apache Maven
Gradle
The structure of our sample web service
Developing RESTful web services
Summary
Chapter 3: The First Endpoint
The Inventory service
REST and the MVC pattern
Running the service
A few words on data representation
Summary
Chapter 4: Data Representation
The Data-Transfer-Object design pattern
The API response format
API evolutions
Summary
Chapter 5: CRUD Operations in REST
Mapping CRUD operations to HTTP methods
Creating resources
Updating resources
Deleting resources
Overriding the HTTP method
Summary
Chapter 6: Performance
HTTP compression
HTTP caching
Room availability
Summary
Chapter 7: Dealing with Security
The booking service
Authentication
Authorization
Input validation
Encryption
Summary
Chapter 8: Testing RESTful Web Services
Unit testing Spring controllers
Mocking
Testing security
Integration testing
Other forms of testing
Summary
Chapter 9: Building a REST Client
The basic setup
Remote versus local clients
Handling security
Exception handling
Summary
Chapter 10: Scaling a RESTful Web Service
Clustering
Distributed caching
Asynchronous communication
Summary

What You Will Learn

  • Deep dive into the principles behind REST
  • Expose CRUD operations through RESTful endpoints with the Spring Framework
  • Devise response formats and error handling strategies, offering a consistent and flexible structure to simplify integration for service consumers
  • Follow the best approaches for dealing with a service’s evolution while maintaining backward compatibility
  • Understand techniques to secure web services
  • Comply with the best ways to test RESTful web services, including tips for load testing
  • Optimise and scale web services using techniques such as caching and clustering

Authors

Table of Contents

Chapter 1: A Few Basics
REST principles
The Spring Framework and REST
Our RESTful web service
Summary
Chapter 2: Building RESTful Web Services with Maven and Gradle
Apache Maven
Gradle
The structure of our sample web service
Developing RESTful web services
Summary
Chapter 3: The First Endpoint
The Inventory service
REST and the MVC pattern
Running the service
A few words on data representation
Summary
Chapter 4: Data Representation
The Data-Transfer-Object design pattern
The API response format
API evolutions
Summary
Chapter 5: CRUD Operations in REST
Mapping CRUD operations to HTTP methods
Creating resources
Updating resources
Deleting resources
Overriding the HTTP method
Summary
Chapter 6: Performance
HTTP compression
HTTP caching
Room availability
Summary
Chapter 7: Dealing with Security
The booking service
Authentication
Authorization
Input validation
Encryption
Summary
Chapter 8: Testing RESTful Web Services
Unit testing Spring controllers
Mocking
Testing security
Integration testing
Other forms of testing
Summary
Chapter 9: Building a REST Client
The basic setup
Remote versus local clients
Handling security
Exception handling
Summary
Chapter 10: Scaling a RESTful Web Service
Clustering
Distributed caching
Asynchronous communication
Summary

Book Details

ISBN 139781785285714
Paperback128 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Spring Microservices Book Cover
Spring Microservices
$ 39.99
$ 28.00
Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Learning Spring Boot Book Cover
Learning Spring Boot
$ 26.99
$ 18.90
Mastering Microservices with Java Book Cover
Mastering Microservices with Java
$ 35.99
$ 25.20
AngularJS Web Application Development Blueprints Book Cover
AngularJS Web Application Development Blueprints
$ 29.99
$ 21.00
AngularJS UI Development Book Cover
AngularJS UI Development
$ 26.99
$ 18.90