There's nothing "wrong" with injection it just doesn't add anything other than a layer of indirectly. Since these are essentially static, I really don't see a reason to instantiate them just so you can inject them. .NET has become obsessed with "interface per class" to do Moq/Mock based unit testing. I don't think that kind of testing really adds anything and in this case, it isn't actually possible. If you look for my TDD talk on here you'll be able to see my take on that kind of testing.
Since it's being injected into a public class, an internal class wouldn't work. That properties also need to be accessed outside the class and therefore need to be public. Honestly though, since this is my own app, running on my service, there are few attack vectors for having this public.
Thanks for the great talk!
That was excellent. Exactly what I was after. Thank you!
Thank you for this great talk full of all the practical advice
I personally prefer the static implementation of the DiagnosticConfig as opposed to injecting it. Nice to know it can be done that way as well.
Super talk! Love to see a part 2 😁😁
I do this talk about 4 times a year, and every time it has more information... unfortunately I have to remove some too!
Great talk!
Very interesting talk! :)
Wow a lot of internet manual/tutorial over the internet MUST he updated, there are a lot of changes with this new version.
I did not unterstand properly: what is particular wrong with his injection implementation ?
There's nothing "wrong" with injection it just doesn't add anything other than a layer of indirectly.
Since these are essentially static, I really don't see a reason to instantiate them just so you can inject them. .NET has become obsessed with "interface per class" to do Moq/Mock based unit testing. I don't think that kind of testing really adds anything and in this case, it isn't actually possible.
If you look for my TDD talk on here you'll be able to see my take on that kind of testing.
Very useful talk, thanks! but at @22:49 you are using a public field, how come?
Since it's being injected into a public class, an internal class wouldn't work. That properties also need to be accessed outside the class and therefore need to be public.
Honestly though, since this is my own app, running on my service, there are few attack vectors for having this public.
a bit aggressive tone. also would be good if the data generated could be shared. other than that good presentation, thank you.