Introduction
Dependency Inversion is a well-known software development principle, described by Robert C. Martin as the responsible of sy...
For further actions, you may consider blocking this person and/or reporting abuse
Hey man, great article!! I always try to implement this pattern on my code. One thing that a make different, is that I use defdelegate on the port, I think that make the code more easy to understand. But thanks for the excellent article
Doesn't assigning it to
@adaptermake it a compiled variable, breaking theApplication.put_envtrick?Yes @03juan, didn't notice that
I think you're right, in this case we need to move to a private function instead
defp adapter, do: Application.get_env(:my_system, __MODULE__)Doesn't it?
Yep! You right! I already change this implementation, and now I use Application.get_env instead
Great tip, Bruno! Thanks for the feedback
Awesome content!
Paring this with mox for testing makes testing so much simpler
Yep! I like to use with Hammox! It's a really good abstraction for the mox