Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
Break the glue. Decouple your high-level business logic from low-level implementation details and build a notification system that is truly "Fluid".
High-Level Module
The Notifier is "glued" to Email. You can't swap it without changing the Notifier code.
The Rigidity Problem
The Notifier depends on a specific implementation. To send an SMS, you must modify the UserNotifier class. This is unstable.
🔄 Dependency Inversion Principle: High-level modules should not depend on low-level modules. Both should depend on abstractions. Invert the dependency so that your core logic is never "glued" to a specific technology.
Practical exercises to master the concepts.
Make a ProfileService depend on a Storage interface instead of a LocalStorage class.