Been thinking a lot lately about how to teach about IoC and how to use containers such as StructureMap (and others which are not worth mentioning ;)) to someone who either is coming in cold to DI/IoC or has a vague awareness of what it is.
Personally, the stages I went through (and have seen few other people go through similarly) are:
1.) Replace all (most?) new()'s with ObjectFactory.GetInstance<T>. You get some immediate benefit out of this and it opens up some new opportunities for your code, but doesn't even scratch the surface
2.) Move to ctor injection with very explicitly defined instances/pluginfamilies/etc and not using auto-wiring. Maybe you still even have an old-fashioned C'tor that still satisfies its own dependencies for those times when 'you might not be using an IoC container'
3.) Embrace auto-wiring, remove non-IoC/DI c'tors and trust fully the container
4.) Start using more advanced techniques like lifecycle management, profiles, convention-based dependency satisfaction, etc
5.) Auto-registration, full trust of the IoC. Thoughts start to pop up like, 'I wonder if I could get the Container to write my app for me??'
6.) ???
Do you necessarily have to go through all these stages, or is there some shortcut to get someone to unlearn procedural style code and fully embrace IoC and jump right to Level 3 or 4 quickly?
Site note: I believe I'm, personally, at level 5 right now and I'm wondering, what goes on in Level 6 that I'm currently missing out on? What about 7+?