Back to course home
0% completed
Vote For New Content
Refactoring Code to Follow DIP
In the previous lesson, we saw how a tightly coupled design violates the Dependency Inversion Principle (DIP). To follow DIP, we need to introduce abstractions and make both high-level and low-level modules depend on them, rather than depending directly on each other.
Step 1: Introduce an Abstraction
We’ll start by creating an abstraction for sending notifications. This abstraction will be an interface called NotificationSender
, which defines a method for sending notifications.
.....
.....
.....
Like the course? Get enrolled and start learning!
On this page