Skip to main content

2023 | Buch

Spring 6 Recipes

A Problem-Solution Approach to Spring Framework

verfasst von: Marten Deinum, Daniel Rubio, Josh Long

Verlag: Apress

insite
SUCHEN

Über dieses Buch

This in-depth Spring-based Java developer code reference has been updated and now solves many of your Spring Framework 6 problems using reusable, complete and real-world working code examples. Spring 6 Recipes (5th Edition) now includes Spring Native which speeds up your Java-based Spring Framework built enterprise, native cloud, web applications and microservices. It also has been updated to now include Spring R2DBC for Reactive Relational Database Connectivity, a specification to integrate SQL databases, like PostgreSQL, MySQL and more, using reactive drivers.
Furthermore, this book includes additional coverage of WebFlux for more reactive Spring web applications. Reactive programming allows you to build systems that are resilient to high load, especially common in the more complex enterprise, native cloud applications that Spring Framework lets you build. This updated edition also uses code snippets and examples based on newest available standard long term support release of Java. When you start a new project, you’ll be able to copy the code and configuration files from this book, and then modify them for your specific Spring Framework-based application needs. This can save you a great deal of work over creating a project from scratch.
This powerful code reference is a "must have" for your print or digital library. This developer cookbook comes with accompanying source code that is freely available on GitHub under latest Creative Commons open source licensing.
What You'll LearnGet re-usable code recipes and snippets for core Spring, annotations and other development toolsDive into Spring Native which merges the popular Spring and GraalVM for increased performance, speed and reliability of your Spring Framework 6 applicationsExplore Spring R2BC for reactive relational database connectivity with SQLBuild reactive Spring MVC-based web applications and microservices using WebFluxEnhance your enterprise or native cloud applications using Spring Transaction ManagementTest, secure and deploy your Spring applications using reusable code templates availableWho This Book Is For
This book is for experienced Java programmers, software developers with experience using the Spring Framework.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Spring Core Tasks
Abstract
In this chapter, you’ll learn about the core tasks associated with Spring. At the heart of the Spring Framework is the Spring Inversion of Control (IoC) container. The IoC container is used to manage and configure POJOs or Plain Old Java Objects. Because one of the primary appeals of the Spring Framework is to build Java applications with POJOs, many of Spring’s core tasks involve managing and configuring POJOs in the IoC container.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 2. Spring MVC
Abstract
MVC is an important module of the Spring Framework. It builds on the powerful Spring IoC container and makes extensive use of the container features to simplify its configuration.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 3. Spring MVC: REST Services
Abstract
In this chapter, you will learn how Spring addresses Representational State Transfer, usually referred to by its acronym REST. REST has had an important impact on web applications since the term was coined by Roy Fielding in the year 2000.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 4. Spring WebFlux
Abstract
When the Servlet API was initially released, the majority of the implementing containers used a thread per request, which meant a thread was blocked until the request processing had finished and the response was sent to the client. However, in those early days, there weren’t as many devices connected to the Internet as nowadays. Due to the increased number of devices, the number of HTTP requests handled has grown significantly. Due to this increase, for a lot of web applications, keeping a thread blocked isn’t feasible anymore. In the last couple of years, there has been an uprising in reactive programming, and with Spring it is possible to write reactive web applications. To be reactive Spring utilizes Project Reactor as an implementation of the Reactive Streams API. It goes beyond the scope of this book to do a full dive into reactive programming, but in short it is a way of doing non-blocking functional programming.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 5. Spring Security
Abstract
In this chapter, you will learn how to secure applications using the Spring Security framework. Spring Security was initially known as Acegi Security, but its name has been changed since joining with the Spring Portfolio projects. Spring Security can be used to secure any Java application, but it’s mostly used for web-based applications. Web applications, especially those that can be accessed through the Internet, are vulnerable to hacker attacks if they are not secured properly.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 6. Data Access
Abstract
In this chapter, you will learn how Spring can simplify your database access tasks (Spring can also simplify your NoSQL and BigData tasks, which is covered in Chapter 9). Data access is a common requirement for most enterprise applications, which usually require accessing data stored in relational databases. As an essential part of Java SE, Java Database Connectivity (JDBC) defines a set of standard APIs for you to access relational databases in a vendor-independent fashion.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 7. Spring Transaction Management
Abstract
In this chapter, you will learn about the basic concept of transactions and Spring’s capabilities in the area of transaction management. Transaction management is an essential technique in enterprise applications to ensure data integrity and consistency. Spring, as an enterprise application framework, provides an abstract layer on top of different transaction management APIs. As an application developer, you can use Spring’s transaction management facilities without having to know much about the underlying transaction management APIs.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 8. Spring Batch
Abstract
Batch processing has been around for decades. The earliest widespread applications of technology for managing information (information technology) were applications of batch processing. These environments didn’t have interactive sessions and usually didn’t have the capability to load multiple applications in memory. Computers were expensive and bore no resemblance to today’s servers. Typically, machines were multiuser and in use during the day (time-shared). During the evening, however, the machines would sit idle, which was a tremendous waste. Businesses invested in ways to utilize the offline time to do work aggregated through the course of the day. Out of this practice emerged batch processing.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 9. Spring Data Access with NoSQL
Abstract
Most applications use a relational database like Oracle, MySQL, or PostgreSQL; however, there is more to data storage than just SQL databases. There are
Marten Deinum, Daniel Rubio, Josh Long
Chapter 10. Spring Java Enterprise Services and Remoting Technologies
Abstract
In this chapter, you will learn about Spring’s support for the most common Java enterprise services: Java Management Extensions (JMX), sending email with Jakarta Mail, and scheduling tasks with and without Quartz. In addition, you’ll learn about Spring’s support for SOAP web services.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 11. Spring Messaging
Abstract
In this chapter, you will learn about Spring’s support for messaging. Messaging is a very powerful technique for scaling applications. It allows work that would otherwise overwhelm a service to be queued up. It also encourages a decoupled architecture. A component, for example, might only consume messages with a single java.util.Map-based key/value pair. This loose contract makes it a viable hub of communication for multiple, disparate systems.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 12. Spring Integration
Abstract
In this chapter, you will learn the principles behind enterprise application integration (EAI), used by many modern applications to decouple dependencies between components. The Spring Framework provides a powerful and extensible framework called Spring Integration. Spring Integration provides the same level of decoupling for disparate systems and data that the core Spring Framework provides for components within an application. This chapter aims to give you all the required knowledge to understand the patterns involved in EAI, to understand what an enterprise service bus (ESB) is andultimatelyhow to build solutions using Spring Integration. If you’ve used an EAI server or an ESB, you’ll find that Spring Integration is markedly simpler than anything you’re likely to have used before.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 13. Spring Testing
Abstract
In this chapter, you will learn about basic techniques you can use to test Java applications and the testing support features offered by the Spring Framework. These features can make your testing tasks easier and lead you to better application design. In general, applications developed with the Spring Framework and the dependency injection pattern are easy to test.
Marten Deinum, Daniel Rubio, Josh Long
Chapter 14. Caching
Abstract
When a heavy computation is done in a program, retrieval of data is slow, or the retrieved data hardly ever changes. It can be useful to apply caching. Caching is the ability to store and retrieve data, transparently, so that data can be served quicker to the client.
Marten Deinum, Daniel Rubio, Josh Long
Backmatter
Metadaten
Titel
Spring 6 Recipes
verfasst von
Marten Deinum
Daniel Rubio
Josh Long
Copyright-Jahr
2023
Verlag
Apress
Electronic ISBN
978-1-4842-8649-4
Print ISBN
978-1-4842-8648-7
DOI
https://doi.org/10.1007/978-1-4842-8649-4