Overview

1 Spring in the real world

Spring is presented as a widely used application framework in the Java/JVM ecosystem, valuable for building many kinds of software, especially backend systems. The chapter explains that frameworks provide reusable foundations and common capabilities so developers do not need to implement every technical concern from scratch. Instead of focusing effort on repeated “plumbing” such as logging, security, database access, transactions, communication, caching, and testing support, teams can concentrate more on the application’s business logic.

The chapter describes Spring not as a single tool but as a broad ecosystem of related frameworks and projects. Spring Core provides the foundation, including the Spring context and inversion of control, where Spring manages application objects and coordinates how they are used. Other parts of the ecosystem support web development, database persistence, testing, security, cloud-native systems, batch processing, and simplified configuration through Spring Boot. The central idea is that developers choose the Spring capabilities that fit their application and assemble them according to the project’s needs.

The chapter also emphasizes practical judgment: Spring is powerful, but it is not always the right choice. It is commonly useful for backend applications, automation testing tools, and sometimes desktop applications, because these systems often need integration, persistence, communication, and maintainable object management. However, frameworks may be inappropriate when an application must have a very small footprint, when strict security rules require only custom code, when excessive customization would outweigh the benefits, or when replacing an existing working solution would bring little value. The overall message is to learn Spring’s foundations while also understanding when its use genuinely improves a system.

David ordered a wardrobe from the UAssemble store. But the store (framework) doesn’t deliver to David (the programmer) just the components (software capabilities) he needs to build his new wardrobe (the app). The store ships him all the possible parts he might need to build the wardrobe. It’s David’s (the programmer’s) choice on which components (software capabilities) are right and how to assemble them to get the right result (the application).
The user’s perspective is like viewing an iceberg. Users mainly observe the results of the business logic code, but this is only a small part of what builds the app’s complete functionality. Like an iceberg that is mostly underwater and hidden from view, we don't see most of the code in an enterprise app because it's provided by dependencies.
You can imagine the Spring framework as a solar system with the Spring Core in the center. The software capabilities are planets around Spring Core kept close to it by its gravitational field.
Inversion of control. Instead of executing its own code, which makes use of several other dependencies, in an IoC scenario, the app execution is controlled by the dependency. The Spring framework controls an app during its execution. Therefore, Spring implements an IoC scenario of execution.
A backend app interacts in several ways with other apps and uses databases to manage data. Usually, a backend app is complex and may require the use of various technologies. Frameworks simplify the implementation by providing tools you can use to implement the backend solution faster.
The possibilities of using Spring in a backend application are endless, from exposing functionalities that other applications can call to managing the database access, and from securing the application to managing integration through third-party message brokers.
The team deploys the testing app in a test environment. A continuous integration tool like Jenkins executes the app regularly and sends feedback to the team. This way, the team is always aware of the system’s status, and they know if they break something during development.
A testing app might need to connect to databases or communicate with other systems or the tested system. The developers can use components of the Spring ecosystem to simplify the implementations of these functionalities.

Summary

  • An application framework provides common software functionality and a structure for building applications more efficiently and reliably.
  • Frameworks like Spring also offer access to large communities, making it easier to find solutions, guidance, and best practices.
  • When choosing a framework, always evaluate its purpose, alternatives, maturity, and community adoption.
  • Spring is more than a single framework—it is an ecosystem of projects. In this book, we’ll mainly use Spring Core, Spring Data, and Spring Boot.
  • Although Spring is commonly associated with backend systems, it can also be used for desktop applications, testing tools, and other kinds of software.

FAQ

What is an application framework?An application framework is a set of reusable software functionalities that provides a foundation for building applications. It helps developers avoid writing every part of an application from scratch by offering common tools and structures that can be assembled and customized for a specific app.
Why do developers use frameworks?Developers use frameworks to save time, reduce costs, avoid rewriting common functionality, and rely on code that has already been tested by many other developers. Frameworks often provide reusable solutions for logging, security, transactions, database access, communication between applications, caching, and other common application needs.
What is the difference between a framework and a library?A library is code that your application calls when it needs help with a specific task. A framework is a larger structure that helps organize the application and often controls how the application runs. In short: with a library, your code calls it; with a framework, the framework calls your code.
What is business logic in an application?Business logic is the part of the code that implements the actual requirements and use cases of the application. It represents what users expect the application to do, such as generating an invoice when a user clicks a link or requesting a car in a ridesharing app.
What is “plumbing code”?Plumbing code refers to the supporting technical code that is necessary for an application to work but is not specific to the app’s business purpose. Examples include logging, security, database transactions, data consistency, communication mechanisms, caching, and performance-related functionality.
What is the Spring framework?Spring is an application framework in the Java/JVM ecosystem. It is widely used to build many kinds of applications, especially backend applications. More broadly, Spring is an ecosystem of frameworks and projects, including Spring Core, Spring MVC, Spring Data, Spring Security, Spring Boot, Spring Cloud, and others.
What is Spring Core?Spring Core is the foundational part of Spring. It includes essential capabilities such as the Spring context, also known as the IoC container, which manages object instances in an application. It also includes features such as aspects and the Spring Expression Language, which help Spring integrate with and control parts of your application.
What is inversion of control, or IoC?Inversion of control is a principle where control over parts of the application is given to a framework instead of being handled only by the application’s own code. In Spring, this means the framework can create objects, manage them, call methods, and apply additional behavior based on configuration.
In what real-world scenarios is Spring commonly used?Spring is commonly used for backend applications, automation testing applications, and sometimes desktop applications. Backend development is the most common scenario because Spring provides tools for web APIs, database access, transactions, security, integration with other systems, and testing.
When should you avoid using a framework like Spring?You should consider avoiding a framework when the application must have a very small footprint, when strict security requirements forbid third-party or open-source code, when the framework requires so much customization that it creates more work than writing custom code, or when an existing working application would not gain meaningful benefits from switching to a framework.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Spring Start Here, Second Edition ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Spring Start Here, Second Edition ebook for free