Inversion of Control (IOC) and Dependency Injection (DI) are used interchangeably. ... By DI the responsibility of creating objects is shifted from our application code to Spring container hence the phenomenon is called IOC. Dependency Injection can be done by setter injection, constructor injection.