Constructor injection supplies an object’s dependencies through its constructor parameters. In Spring, the framework passes matching beans from its context when it creates the object. section 3.2.2
Declare a constructor parameter for each dependency, assign it to a field, and make the field final when it should not change after initialization. Spring can wire the dependency without changes to the configuration class. A single-constructor class does not need @Autowired starting with Spring 4.3. section 3.2.2
A person with a parrot
A Person constructor accepts a Parrot and assigns it to a final field. Spring supplies the Parrot bean, linking the two instances; the same constructor can also receive a Parrot directly in a unit test without Spring. section 3.2.2
Figure 3.10 When you define a parameter of the constructor, Spring provides a bean from its context as a value to that parameter when calling the constructor.

Shows Spring providing a context bean as a constructor argument. section 3.2.2
Constructor injection is generally preferred over field and setter injection because it supports immutability, readability, and testability. If several beans match a parameter’s type, Spring may need additional guidance, such as @Primary or @Qualifier. section 3.6 section 3.4


