Silva
✅ Receiving any instance of a generic class in a method, no matter what the generic type is.
Anyway, sorry if I derailed the conversation, but it did genuinely help me understand some more concepts!
Thanks @ZZZZZZZZZZZZZZZZZZZZZZZZZ and @Denis for the help, and thanks for the genuinely interesting conversation! :)
167 replies
✅ Receiving any instance of a generic class in a method, no matter what the generic type is.
I think it's more of a matter of where you want to be explicit, not as much as if it is or isn't explicit?
"The first point is that both implementations provide the fundamental decoupling that's missing in the naive example - in both cases application code is independent of the concrete implementation of the service interface. The important difference between the two patterns is about how that implementation is provided to the application class. With service locator the application class asks for it explicitly by a message to the locator. With injection there is no explicit request, the service appears in the application class - hence the inversion of control."
(highlight is my own)
167 replies
✅ Receiving any instance of a generic class in a method, no matter what the generic type is.
https://martinfowler.com/articles/injection.html
This I think represents a little bit what we are discussing
167 replies
✅ Receiving any instance of a generic class in a method, no matter what the generic type is.
If I was using DI I'd have to have one point where I'd register all my events, and then both invokers and observers would have to request a reference to that event.
In my system, it's all abstracted behind one class.
167 replies