Thanks for the response and pointing out some confusing issues in it.

Here IoC is a general concept while DI is an implementation merely using IoC concept.

I will look into ‘Poor Man’s DI’ as you mentioned as I haven’t run into that. By the first glance it looks like it is an exception but most of the time Dependency Inversion Principle -> IoC -> DI holds true. I gather that conceptually DI, IoC are generic terms but more beneficial when working together. Please refer to these articles with similar idea.

As per Service Locator I had not dig into that very much but basically service locator pattern asks for dependencies from ServiceLocator class and not directly from concrete implementation. Here the using class is not aware of the concrete implementation and the control is passed to ServiceLocator (Hence pretty much the idea of Inverting of control)

Please look into these points and clarify if there’s anything. (Point out anything that needs to be changed since I’m amateur writer.)


Full Stack Developer | BiBi

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