1
vote
5answers
3k views

Dependency Injection Confusion

I think I have a decent grasp of what Dependency Inversion principle (DIP) is, my confusion is more around dependency injection. My understanding is the whole point of DI is to decouple parts of an ...
9
votes
2answers
647 views

What's the practical difference between the styles of dependency injection?

I'm new to dependency injection and I have a few questions about which style I shouldI use in my applications. I've just read Inversion of Control Containers and the Dependency Injection pattern by ...
1
vote
2answers
840 views

IoC containers and service locator pattern

I am trying to get an understanding of Inversion of Control and the dos and donts of this. Of all the articles I read, there is one by Mark Seemann (which is widely linked to in SO) which strongly ...
4
votes
2answers
221 views

Dependency injection and IOC containers in a closed project

Does it make sense to assemble my project with dependency injection containers if I am the only one who will use the code of that project? The question came up when I read this IOC Article ...
3
votes
2answers
260 views

When is using DI and optionally a IoC framework a step too far?

Consider a logging system - used absolutely everywhere in your codebase. (note - logging is just an example, don't take it too literally and point me at your favourite logging system). public ...
44
votes
4answers
8k views

What is inversion of control, and when should I use it?

I am designing a new system and I want to know what inversion of control (IOC) is, and more importantly, when to use it. Does it have to be implemented with interfaces or can be done with classes?