¡@

Home 

c# Programming Glossary: icanlog

Why does one use dependency injection? [closed]

http://stackoverflow.com/questions/14301389/why-does-one-use-dependency-injection

Obviously it's a quite good idea to introduce an interface ICanLog or similar that is implemented by all the various loggers. So.. the various loggers. So step 1 in your code is that you do ICanLog logger new Logger Now the type inference doesn't change type.. to a single central factory class and you get code such as ICanLog logger LoggerFactory.Create The factory itself decides what..