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:

a guide to the MUI Grid system

A guide to the MUI grid system

Explore the MUI Grid system in depth, including updates from MUI v5, and learn how to build responsive grid layouts.

Gaurav Singhal
Apr 11, 2025 â‹… 8 min read
Building Progressive Web Apps (PWAs) Using Rust

Building progressive web apps using Rust

Build a progressive web app using Rust, WebAssembly, SurrealDB, and Nostr with local encryption and fast storage.

Mario Zupan
Apr 11, 2025 â‹… 18 min read
how to use svgs in react

A guide to using SVGs in React

Explore various ways to implement SVGs in React applications, and learn about their integration, animation, and usage as React components.

Nedy Udombat
Apr 10, 2025 â‹… 15 min read
What is AI code generation and how does it work?

What is AI code generation and how does it work?

Discover how AI code generation works and explore top artificial intelligence coding tools, benefits, and real-world use cases.

Chizaram Ken
Apr 10, 2025 â‹… 4 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