Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
Unleash the power of SRP. Identify multiple responsibilities in a single class and refactor them into modular, clean components.
The God Class Problem: The OrderManager class is currently doing everything. Help it follow the Single Responsibility Principle by moving methods into their specialized classes.
Assign each method to the class that represents its primary responsibility.
🎯 Single Responsibility Principle: A class should have one, and only one, reason to change. If your class handles UI and DB logic, it has two reasons to change.
Practical exercises to master the concepts.
Identify two responsibilities in a Invoice class (printing and saving) and split them.