C# based simple service locator
I’ve always loved the Service locator pattern – why ? Because it requires so little maintenance, and it’s a very crucial point if you want somewhat automatic dependency injection.
As you can read in my blog post “Staying DRY: Mind those switch statements” a service locator can replace cumbersome multiple switch statements which require each one to be changed whenever a new case comes along.