Summary

Dependency injection (or IoC) is the key feature of Spring. It makes code loosely coupled and testable. Understanding DI is the key to making the best use of Spring Framework.

In this chapter, we took a deep look at DI and the options Spring Framework provides. We also looked at examples of writing testable code and wrote a couple of unit tests.

In the next chapter, we will shift our attention toward Spring MVC, the most popular Java web MVC framework. We will explore how Spring MVC makes the development of web applications easier.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.