© Adam L. Davis 2020
A. L. DavisSpring Quick Reference Guidehttps://doi.org/10.1007/978-1-4842-6144-6_3

3. Dependency Injection

Adam L. Davis1 
(1)
Oviedo, FL, USA
 

Dependency Injection (DI) is at the heart of Spring. It refers to plugging in references at runtime between many different objects, either through a constructor, setter, or even directly to a field using runtime reflection. This enables IOC (Inversion of Control) where one class can use an instance of another class without knowing any details about how that object was constructed or its exact implementation class.

Spring’s design allows the use of POJOs (Plain Old Java Objects). In other words, you don’t need to implement a specific interface or extend a class in order to use Spring’s DI. ...

Get Spring Quick Reference Guide: A Pocket Handbook for Spring Framework, Spring Boot, and More 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.