Cool article!
André Herculano
1

Thank you 😃 All in all, I enjoy being minimal and only resort to DI when needed, i.e., when it enables more focused unit testing or there’s a (very rare) necessity to switch out the renderer. In other words, I visualize PrintedBooks and its dependencies as a single unit.

In this particular case, I would perhaps test important parts of the HTML with a tool like NokoGiri or even a simple regex to see if some text is present (if that’s what really matters), so I’m not sure whether I would use DI there.

Like what you read? Give Thiago Araújo Silva a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.