Relative Content

Tag Archive for inversion-of-control

DI: Can a stable dependency have a volatile dependency?

I’ve recently been reading through Mark Seemann’s Dependency Injection in .NET and have been attempting to apply some of what I’ve learned in a new project I’m working on, and I’m stumped on a particular scenario trying to determine what dependencies I should and should not inject. I’ve read several other questions on SO and elsewhere that discuss similar scenarios but in a roundabout manner, and I think I’ve narrowed the underlying conceptual question to that which is in the title:

Does following TDD inevitably lead to DI?

I learned to do Test Driven Development (TDD), Dependency Injection (DI) and Inversion of Control (IoC) all at the same time. When I write code using TDD I always end up using DI in my class’s constructors. I am wondering if this is because of how I learned to do TDD, or if this is a natural side-effect of TDD.

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 asks folks not to use the service locator pattern.

CQRS with Repository pattern and Inversion of Control (with DI)

I assigned a POC project to someone where I asked to implement both Command Query Responsibility Segregation, Inversion of Control (with Dependency Injection) and Repository pattern. “Someone” gave me a POC solution project but I am not sure whether this is the way it is done. I will brief here about the POC project

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 should use in my applications. I have just read Inversion of Control
Containers and the Dependency Injection pattern
by Martin Fowler, but I
can’t get the practical difference between constructor, setter and interface
injection.

XML Documentation for IoC Classes

I’m working on an application that uses Inversion of Control to achieve loose coupling between the Data Access and Business Layers.