skip to the main content area of this page
Patterns and Practices

 

Common Service Locator Library - IServiceLocator Interface Abstracting IoC Containers


I think it has been a proven practice for some time now to minimize the footprint of your chosen Dependency Injection Tool / Inversion of Control Container in your .NET Applications / Frameworks / Libraries in case someone wants to choose a different one.

If you look back at some of my posts on the Web Client Software Factory, you will notice that I created a Simple Web Application Block that completely abstracts out the dependency injection mechanism so I can use what the customer wanted to use:

I also abstracted out Enterprise Library, because why should our domain model be dependent on infrastructure services :)

There is a project on CodePlex, called Common Service Locator Library, that suggests a defacto IServiceLocator Interface be agreed upon so users have the ability to choose their dependency injection tool of choice when using your libraries and frameworks.

There are providers already built for Unity and Castle Windsor and I suspect more will follow. Interesting stuff.

Learn more about the Common Service Locator Library and IServiceLocator Interface here.


Tags: DependencyInjection, IoC


Free Online Storage

Dropbox turned 1.0! Sign up for 2GB of free online storage for photos and home videos as well as important documents and files.


Topics



 

Recent Links