Wednesday, May 23, 2018

dependency injection (DI) vs inversion of control (IoC) ?

Problem statement: what do you mean by dependency injection (DI) and inversion of control (IoC)?
  • IoC (Inversion of Control): giving control to the container to get instance of an object is called inversion of control, meaning instead i'm creating the object using new operator, let container do that for me.
  • DI (Dependency Injection): way of injecting (providing) properties to an object is called DI.
  • Types of Dependency Injection
  1. Constructor Injection
  2. Setter/Getter Injection - property in xml
  3. Interface Injection (spring does not support)

No comments:

Post a Comment

How to run standalone mock server on local laptop

 Please download the standalone wiremock server from Direct download section at the bottom of the page.  Download and installation Feel fre...