DEV Community

Discussion on: Explain IoC Container like I'm Five

Collapse
 
greenfieldcoder profile image
Jimmy

I have recently tried to explain IoC to my co-workers, and I discribe it as the magical thing that make dependency injection work, without us doing anything but focusing on writing new features. It's automagical.

Before I knew about IoC, I wrote my own new statements and building the dependency tree manually. Sometimes, that tree got huge and if I needed to change some dependency, all my trees had to be updated. IoC takes care of all that stuff at runtime.