Disadvantages of the constructor-based DI

The only disadvantage of the constructor-based injection is that it may cause circular dependency between objects. Circular dependency means two objects depend on each other. For resolving that, we should use a setter injection instead of a constructor injection.

Let's see a different type of DI in Spring, which is a setter-based injection.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset