The first version of Spring Framework was released in March 2004. In the subsequent decade and a half, the use and popularity of Spring Framework only grew.
The important reasons behind the popularity of Spring Framework are as follows:
- Simplified unit testing--because of dependency injection
- Reduction in plumbing code
- Architectural flexibility
- Keeping up with changing times
Let's discuss each of these in detail.
Earlier versions of EJBs were very difficult to unit test. In fact, it was difficult to run EJBs outside the container (as of version 2.1). The only way to test them was to deploy them in a container.
Spring Framework brought in the concept of Dependency Injection (DI). We will discuss dependency injection in complete detail in Chapter 2, Dependency Injection.
The dependency injection enables unit testing by making it easy to replace the dependencies with their mocks. We do not need to deploy the entire application to unit test it.
Simplifying...