Book description
Discover ways to enhance your application's functionality through hands-on learning for designing, testing, securing, deploying, and maintaining production-ready APIs
Key Features
- Learn how to design, develop, test, and deploy modern APIs in Java
- Explore techniques for optimizing API performance and handling errors
- Secure your APIs with industry-standard authentication and authorization techniques
- Get a free PDF eBook with the purchase of the print or Kindle book
Book Description
Spring is a powerful and widely adopted framework for building scalable and reliable web applications in Java, complemented by Spring Boot, a popular extension to the framework that simplifies the setup and configuration of Spring-based applications. This book is an in-depth guide to harnessing Spring 6 and Spring Boot 3 for web development, offering practical knowledge of building modern robust web APIs and services.
The book covers a wide range of topics that are essential for API development, including RESTful web service fundamentals, Spring concepts, and API specifications. It also explores asynchronous API design, security, designing user interfaces, testing APIs, and the deployment of web services. In addition to its comprehensive coverage, this book offers a highly contextual real-world sample app that you can use as a reference for building different types of APIs for real-world applications. This sample app will lead you through the entire API development cycle, encompassing design and specification, implementation, testing, and deployment.
By the end of this book, you’ll have learned how to design, develop, test, and deploy scalable and maintainable modern APIs using Spring 6 and Spring Boot 3, along with best practices for bolstering the security and reliability of your applications and improving your application's overall functionality.
What you will learn
- Create enterprise-level APIs using Spring and Java
- Understand and implement REST, gRPC, GraphQL, and asynchronous APIs for various purposes
- Develop real-world web APIs and services, from design to deployment
- Expand your knowledge of API specifications and implementation best practices
- Design and implement secure APIs with authorization and authentication
- Develop microservices-based solutions with workflow and orchestration engines
- Acquire proficiency in designing and testing user interfaces for APIs
- Implement logging and tracing mechanisms in your services and APIs
Who this book is for
This book is for novice Java programmers, computer science graduates, coding boot camp alumni, and newcomers to the realm of creating real-world web APIs and services. It is an invaluable resource for Java developers transitioning to web development, offering an all-encompassing introduction to web service development. If you possess knowledge of fundamental programming constructs, data structures, and algorithms in Java but lack practical web development experience, this book will serve as a bridge to cultivate the essential skills for entry into the role of a web developer.
Table of contents
- Modern API Development with Spring 6 and Spring Boot 3
- Contributors
- About the author
- About the reviewers
- Preface
- Part 1 – RESTful Web Services
-
Chapter 1: RESTful Web Service Fundamentals
- Technical requirements
- Introducing REST APIs
- Handling resources and URIs
- Exploring HTTP methods and status codes
- What is HATEOAS?
-
Best practices for designing REST APIs
- Using nouns and not verbs when naming a resource in the endpoint path
- Using the plural form for naming the collection resource in the endpoint path
- Using hypermedia (HATEOAS)
- Versioning your APIs
- Nesting resources
- Securing APIs
- Maintaining documentation
- Complying with recommended status codes
- Ensuring caching
- Maintaining the rate limit
- Introducing our e-commerce app
- Summary
- Questions
- Answers
- Further reading
-
Chapter 2: Spring Concepts and REST APIs
- Technical requirements
- Understanding the patterns and paradigms of Spring
- Understanding the application of IoC containers
- Defining a bean and its scope
- Configuring beans using Java
- How to code DI
- Configuring a bean’s metadata using annotations
- Writing code for AOP
- Why use Spring Boot?
- Understanding the importance of servlet dispatcher
- Summary
- Questions
- Answers
- Further reading
- Chapter 3: API Specifications and Implementation
- Chapter 4: Writing Business Logic for APIs
-
Chapter 5: Asynchronous API Design
- Technical requirements
- Understanding Reactive Streams
- Exploring Spring WebFlux
- Understanding DispatcherHandler
-
Implementing reactive APIs for our e-commerce app
- Changing OpenAPI Codegen for reactive APIs
- Adding Reactive dependencies to build.xml
- Handling exceptions
- Handling global exceptions for controllers
- Adding hypermedia links to an API response
- Defining an entity
- Adding repositories
- Adding services
- Adding controller implementations
- Adding H2 Console to an application
- Adding application configuration
- Testing reactive APIs
- Summary
- Questions
- Answers
- Further reading
- Part 2 – Security, UI, Testing, and Deployment
- Chapter 6: Securing REST Endpoints Using Authorization and Authentication
- Chapter 7: Designing a User Interface
- Chapter 8: Testing APIs
- Chapter 9: Deployment of Web Services
- Part 3 – gRPC, Logging, and Monitoring
- Chapter 10: Getting Started with gRPC
- Chapter 11: gRPC API Development and Testing
- Chapter 12: Adding Logging and Tracing to Services
- Part 4 – GraphQL
- Chapter 13: Getting Started with GraphQL
-
Chapter 14: GraphQL API Development and Testing
- Technical requirements
- Workflow and tooling for GraphQL
- Implementing the GraphQL server
- Implementing GraphQL queries
- Writing fetchers for GraphQL queries
- Implementing GraphQL mutations
- Implementing and testing GraphQL subscriptions
- Instrumenting the GraphQL APIs
- Test automation
- Summary
- Questions
- Answers
- Further reading
- Index
- Other Books You May Enjoy
Product information
- Title: Modern API Development with Spring 6 and Spring Boot 3 - Second Edition
- Author(s):
- Release date: September 2023
- Publisher(s): Packt Publishing
- ISBN: 9781804613276
You might also like
book
Full Stack Development with Spring Boot 3 and React - Fourth Edition
Get up and running with the Spring Boot and React stack – build an app from …
book
Learning Spring Boot 3.0 - Third Edition
Build Java web apps without wasting any time with this third edition of the best-selling Spring …
video
Java SE 17 Developer (1Z0-829)
21+ Hours of Video Instruction An intensive and guided video course to learn and practice while …
video
Spring and Spring Boot Fundamentals, 3E
What is this learning path about, and why is it important? For many developers, Spring is …