3 ms·
Here's a blog article by Carbon Five on dependency injection in Elixir that I quite liked... https://blog.carbonfive.com/2018/03/19/lightweight-dependency-inje
by amorphid 8y ago
Here's a blog article by Carbon Five on dependency injection in Elixir that I quite liked...
https://blog.carbonfive.com/2018/03/19/lightweight-dependency-injection-in-elixir-without-the-tears/ https://blog.carbonfive.com/2018/03/19/lightweight-dependenc...
For context, Elixir (which includes Erlang) is a compiled language, but it doesn't/can't catch a lot of compile time type errors that you'd only uncover at runtime. For example, one process can send a message of any type to another process. There just isn't a great way (for the Elixir compiler) to catch that at compile time. It gives you more flexibility, but you can't have confidence that it'll work just because it compiled. Dependency injection with tests is a really helpful tool in Elixir.