2025-02-20
2294
#web design
Samuel Olusola
97873
116
Feb 20, 2025 â‹… 8 min read

Understanding the dependency inversion principle (DIP)

Samuel Olusola Software engineer (JS stack, GoLang incoming…) and student of computer science at the University of Lagos.

Recent posts:

Not Everything Should Be A Chat: Rethinking LLM Integration

Beyond chat: Rethinking how we use LLMs

LLMs can do more than chat! Explore alternative integration models that improve efficiency, reduce complexity, and enhance user control.

Rosario De Chiara
Mar 12, 2025 â‹… 4 min read

A guide to image overlays in CSS

Learn the basics of applying image overlays in CSS and explore more interactive techniques like hover effects and animations.

Ibadehin Mojeed
Mar 11, 2025 â‹… 5 min read

How to use EJS to template your Node.js application

EJS makes working with templates in Node.js super easy — but only if you know how to use it. This guide walks you through the essentials and more.

Samuel Olusola
Mar 11, 2025 â‹… 15 min read
Remote Branches In Git LogRocket

How to check out a remote branch in Git: A step-by-step guide

Learn how to list, fetch, and checkout remote Git branches, plus troubleshoot outdated branch lists effectively.

Oyinkansola Awosan
Mar 11, 2025 â‹… 8 min read
View all posts

7 Replies to "Understanding the dependency inversion principle (DIP)"

  1. Hi, really nice article! A couple of typos in the code examples. You’re writing log.info instead of log.error when an exception occurs. Cheers!

    1. Thanks for the tip — would you mind pointing out the specific code blocks where the typos occur?

  2. A couple of problems with this principle. High level and low level is vaguely defined. If you apply this to the highest levels, this works fine. But the lower you go, the more this will feel the effects of an extra pointer to resolve or an extra function call. So, make sure that in your language, this results in, as much as possible, zero cost abstractions. Interfaces and Traits are typically fine, but watch out with proxies, abstract classes or any form of wrapper constructs.

Leave a Reply