Overview

1 Spring in the real world

Spring is presented as a major application framework in the Java and JVM ecosystem, widely used for everything from backend systems to testing tools and even some desktop applications. The chapter explains that frameworks exist to provide a reusable foundation of common software capabilities, so developers do not need to build every part of an application from scratch. Instead of focusing on all the “plumbing” needed for logging, security, communication, persistence, and testing, developers can concentrate on the business logic that makes an application unique.

The text emphasizes that Spring is more than a single framework: it is an ecosystem of related projects and core capabilities. Spring Core provides the central application context and related features such as aspects and expression support, while other important areas include web development, data access, and testing. The chapter also introduces inversion of control, explaining that Spring manages objects and can control execution flow by creating instances and intercepting methods, which helps applications stay organized and maintainable. Spring Data and Spring Boot are highlighted as especially useful projects, with Spring Boot reducing configuration effort through sensible defaults.

The chapter also stresses that frameworks are not always the right choice. They are especially useful for complex backend applications, automation testing systems, and some desktop applications, but they may be unnecessary for tiny applications, highly restricted security environments, or cases where customization would outweigh the benefits. A key message is to evaluate alternatives carefully and choose the right tool for the job. Overall, the chapter sets up the book’s goal: to teach the essentials of Spring so readers can build maintainable real-world applications and understand when Spring helps most.

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 common software functionalities that provides a foundation structure for developing an application. It helps you build software without writing everything from scratch.
Why do developers use frameworks?Developers use frameworks to save time and effort by reusing common functionality such as logging, security, transactions, communication, and caching, instead of implementing these features repeatedly in every app.
What is the difference between a library and a framework?A library is something your code calls when it needs help with a specific task. A framework is a larger structure that organizes the application and controls its execution, so it calls your code instead.
What is business logic in an application?Business logic is the code that implements the app’s actual business requirements and user-facing functionality, such as generating an invoice when a user clicks a link.
What is “plumbing code”?Plumbing code is the supporting code behind the business logic, such as security, logging, data consistency, communication, and other infrastructure-related concerns.
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 systems, testing apps, and desktop apps.
What does inversion of control (IoC) mean in Spring?IoC means the framework controls the application’s execution instead of the application controlling itself. In Spring, the framework manages objects and can call methods based on configuration.
What are the main parts of the Spring ecosystem mentioned in this chapter?The chapter highlights Spring Core, Spring MVC, Spring Data Access, Spring Testing, and projects such as Spring Data and Spring Boot. These parts work together to support different application needs.
In what real-world scenarios can Spring be used?Spring can be used for backend applications, automation testing applications, and even desktop applications. It is not limited to backend web apps only.
When should you avoid using a framework?You may avoid a framework when you need a very small footprint, when strict security rules require only custom code, when the framework would require too much customization, or when switching 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