I am new to the concept of Unity/Dependency Injection.
My understanding is that you use DI to avoid tightly coupled class structure but I am struggling to see its benefits.
I followed "The Unity Container" section on this link http://www.refactorthis.net/post/2012/10/25/Dependency-Injection-and-Inversion-of-Control-Ioc-With-the-Microsoft-Unity-Container.aspx but I do not know why this is "better" - it introduces a lot more code and still, inside LoggingModule.cs I still have to have this line of code:
_iocContainer.RegisterType(typeof(ILogger), typeof(DBLogger));
Meaning there is still a dependency but I have just moved it into a secluded location. I still have to tell Unity which class I want to use
This question will probably be marked as non-constructive but I would like to be told the benefits and how to use Unity/DI correctly.
Thanks, Andrew