Skip to content

Instantly share code, notes, and snippets.

View dhonig's full-sized avatar

Daniel Honig dhonig

View GitHub Profile
@andreabach
andreabach / Andrea Mercedes Bach Resume - July 2015
Last active September 6, 2018 06:00
Andrea Mercedes Bach Resume - July 2015
Andrea M. Bach
427 5th Ave S., Kirkland, WA 98033 | amercedesbach@hotmail.com | (206) 412-3492
Experience
UnitedHealthcare April 2012 – Present
Senior Marketing Manager, Seattle, WA
@timruffles
timruffles / dyanmic_or_di_elixir.md
Last active June 11, 2020 04:23
Approaches to dependency-injection/dynamic dispatch in elixir

In many production systems you'll want to have one module capable of talking to many potential implementations of a collaborator module (e.g a in memory cache, a redis-based cache etc). While testing it's useful to control which module the module under test is talking to.

Here are the approaches I can see. The two points that seem to divide the approaches are their tool-ability (dialyzer) and their ability to handle stateful implementations (which need a pid).

Passing modules

Modules are first class, so you can pass them in. Used in EEx, where passed module must implement a behaviour.