I'm reading Dependency Injection in .NET by Mark Seemann and I can not for the life of me get my head wrapped around this:
Although the new keyword is a code smell when it comes to VOLATILE DEPENDENCIES, you don't need to worry about using it for STABLE DEPENDENCIES. The new keyword isn't suddenly "illegal" in general, but you should refrain from using it to get instances of VOLATILE DEPENDENCIES.
Maybe it's because I still can't get my head wrapped around ambient context being an injection instead of just a global variable, but I am just not getting what the author is saying.
I'd really like to understand DI top to bottom but right now I'm stuck and this is just a 1/3 the way through the book... The Control-Freak anti-pattern seems to be every single programmer that ever lived...
Anyone have any insights?