I suggest you learn Autofac at http://code.google.com/p/autofac/ .
This is a very good Inversion Of Control container (http://en.wikipedia.org/wiki/Inversion_of_control). You can learn a lot by studying the source and by doing this, you can use it in your projects.
You should ever consider using IoC components to decouple programs.
Regards, Giacomo
source share