Spring Core

Inversion of Control

Dependency Injection

  • As XML configuration is deprecated so we will discuss Autowiring
  • IOC container will look for a class that matches the property, like match by class or interface.
  1. Constructor Injection:
  • Spring will check the argument of constructor based on which it will inject an object which implements Engine but if multiple class implements engine then spring will be in an ambiguous position, so to avoid that we can use @Qualifier(“class name”), now spring will inject specified class.
  • Same like Constructor we can use @Autowire with the setter method

The Spring IoC Container

Lazy Beans Initialized



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store