Hands-on practice for this lecture. Work through the exercises and quizzes to reinforce what you've learned.
Exercise 1 of 1
The ultimate test. A "God Class" stands in your way. Use all five SOLID principles to refactor the spaghetti and claim your title as a Clean Architect.
HEALTH: 100% | CRITICAL VULNERABILITIES: 3
Single Responsibility
The class calculates tax, saves to DB, AND sends emails.
Open-Closed
Uses "if (type == CREDIT_CARD)" for every new payment method.
Dependency Inversion
Directly creates "new EmailService()" inside the constructor.
âš”ï¸ SOLID Boss Battle: Real-world code is often messy. Mastering SOLID isn't just about knowing the definitions; it's about having the "Spaghetti Senses" to identify these violations and the skills to fix them.
Practical exercises to master the concepts.
Refactor the OrderManager by creating a PriceCalculator (SRP), ShippingProvider interface (OCP/DIP), and NotificationService (SRP). Ensure OrderManager only coordinates these services.