Tim Williams
Dec 4, 2020

--

The effort is good, but you only got half way there. For dependency injection your code needs to make use of a service container whereby you can change out your dependencies via configuration or environment or something similar. What you've demonstrated is modularity which is the first step to making DIP, but your Example class still depends directly on your './utils.js' which depends on axios.

--

--

Tim Williams
Tim Williams

Written by Tim Williams

I am a Web Developer passionate about new technologies, as well as time tested best practices (here’s looking at you Uncle Bob).

Responses (1)