The Dependency Inversion Principle

Clean Code In The Browser, Episode 6

By Chris Powers

90 minMar 2019

The time has finally comeā€”an investor is considering buying out the Paintastic 2000! This is the bosses' big chance to strike it rich, but there's one problem: the JavaScript client isn't extensible enough to work with the investor's service layer! Can they refactor and cash in, or will they become yet another failed startup?

In this episode, Chris Powers demonstrates the "D" in SOLID: the Dependency Inversion Principle. Dependency structures can be difficult to visualize in dynamic languages like JavaScript, but they are still there, quietly constraining how your code can be executed and tested. By clearly delineating between high-level policy and low-level implementation details, Chris uses this principle to decouple otherwise twisted code.

But of course, that's not all! Chris and his merry band of minions are up to the usual hijinks. They explore the topic of effective documentation, discussing how to get the most value out of the least effort. Chris also explores team and organization structures, calling out the natural (but dangerous) tendency for teams to fall into rigid roles and static charters.

And let's just say the ending gets EPIC!

So join Chris to level up your code design as he wraps up the last of the SOLID Principles!