Overview

1 Spring in the real world

Spring is presented as a Java/JVM application framework and, more broadly, as an ecosystem of tools that helps developers build real software faster and with less repetitive code. The chapter explains that a framework is a pre-built foundation with an opinionated structure, unlike a library, which your code calls directly. The key benefit is that frameworks reduce the need to write common application “plumbing” such as logging, security, transactions, communication, caching, and testing support, leaving developers to focus mainly on business logic.

The text emphasizes that Spring works through inversion of control, where the framework—not the application—controls object creation and execution flow through an IoC container or Spring context. Spring Core is described as the central piece, with related capabilities such as AOP and SpEL, while Spring Data Access supports persistence, Spring MVC supports web applications, and Spring Testing helps with unit and integration tests. The broader Spring ecosystem also includes projects like Spring Data, Spring Security, Spring Cloud, Spring Batch, and Spring Boot, with Spring Boot highlighted for its convention-over-configuration approach that reduces setup effort.

The chapter also shows where Spring fits in the real world, especially in backend applications that must serve clients, store data, communicate with other systems, and handle security and integration concerns. It notes that Spring can also be useful in automation testing apps and even some desktop applications, but it is not always the right choice. Situations where frameworks may be a poor fit include cases with very small footprint requirements, strict security constraints, excessive customization needs, or existing systems that gain no real benefit from switching; the overall message is to choose technology based on practical advantage rather than popularity.

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 pre-built software foundation with an opinionated architecture and predefined structure that helps you build apps without writing everything from scratch.

Why do developers use frameworks?

Developers use frameworks to save time, reduce repetitive coding, reuse proven solutions, and focus on the application-specific business logic instead of rebuilding common features like logging, security, and data handling.

How is a framework different from a library?

With a library, your code calls the library when it needs help with a task. With a framework, the framework controls the application flow and calls your code when needed.

What is business logic in an application?

Business logic is the code that implements the application’s core business requirements and user-facing functionality, such as generating an invoice or processing a request.

What is meant by “plumbing code”?

Plumbing code refers to the supporting parts of an application, such as security, logging, transactions, caching, data consistency, and communication between components, rather than the main business features.

What is the Spring framework?

Spring is an application framework for the Java/JVM ecosystem. It is widely used to build many kinds of applications, including backend systems, automation testing apps, and desktop applications.

What is inversion of control (IoC) in Spring?

Inversion of control means that instead of your app controlling execution, Spring controls it. Spring manages objects and can intercept method calls based on the configurations you provide.

What are some major parts of the Spring ecosystem?

Major parts include Spring Core, Spring MVC, Spring Data Access, Spring Testing, and projects such as Spring Data, Spring Security, Spring Cloud, Spring Batch, and Spring Boot.

In what real-world scenarios is Spring commonly used?

Spring is commonly used for backend applications, automation test applications, and sometimes desktop applications. It is especially useful when an app needs database access, communication with other systems, security, or testing support.

When should you avoid using a framework?

You may avoid a framework when you need a very small footprint, when security requirements demand only custom code, when the framework would require too much customization, or when switching to it brings no real benefit.

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