O'Reilly logo

Mastering Spring 5 by Ranga Rao Karanam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dependency Injection and Unit Testing

In this chapter, we will start with understanding what dependency is. We will explore the need for DI. We will understand the flexibility Dependency Injection (DI) brings in. After that, we will explore how DI is implemented in the Spring Framework.

DI is the most important feature of the Spring Framework. It makes it easy to develop loosely coupled applications. Loosely coupled applications are easier to unit test and, therefore, a lot easier to maintain.

In the Spring Framework, DI is implemented in the Spring Inversion of Control (IoC) container. 

After the Spring Framework and DI became popular, Jakarta EE (earlier Java EE) introduced a standard specification for DI called the Java Contexts and Dependency ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required