Sign in

Understanding the “D” in “SOLID”

What is Dependency Inversion Principle?

The Dependency Inversion principle is the last of the five SOLID design principles described by Robert C. Martin, which are principles that encourage us to create more understandable, maintainable and flexible software.

The principle of Dependency Inversion states that:

This principle refers to the decoupling of software modules so that instead of high-level modules depending on low-level modules, both will depend on abstractions.

Why is Dependency Inversion Principle Important?

The goal…

Understanding the “O” in “SOLID”

What is the Open-Closed Principle?

The open-closed principle is one of the five SOLID principles for object-oriented software development. It was first defined by Bertrand Meyer in 1988 in his book “Object-Oriented Software Construction”, where he explained it as:

This means that we should write code such that we can add new functionality without changing the existing code.

Why is Open-Closed Principle Important?

This principle is important because it prevents situations where a change in one of the classes requires you to adapt all depending…

Yen Peng

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store