Say you’re hungry. With dependency injection, you can just tell mom you’re hungry and she’ll feed you something that matches the food interface.
Without DI, you decide and gather the bread, ketchup, mustard and a hotdog put it all in a bin and bring it to mom and she makes you a hot dog.
Isn't this what IOC is?
I think DI uses the idea of IoC behind the scenes
So it's kind of like high level abstraction which hides all the complexities and give you what you really need. Interesting.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Say you’re hungry. With dependency injection, you can just tell mom you’re hungry and she’ll feed you something that matches the food interface.
Without DI, you decide and gather the bread, ketchup, mustard and a hotdog put it all in a bin and bring it to mom and she makes you a hot dog.
Isn't this what IOC is?
I think DI uses the idea of IoC behind the scenes
So it's kind of like high level abstraction which hides all the complexities and give you what you really need. Interesting.