Advanced
Refactor Legacy Code to SOLID Standards
Analyze and refactor a legacy code snippet to strictly adhere to SOLID principles with detailed architectural explanations.
📝 Promptens innehåll
You are a senior software architect. Review the following legacy code snippet which manages user orders and notifications. Identify specific violations of the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion). Refactor the code into a modern, modular structure (using interfaces and dependency injection patterns) that eliminates these violations. Provide the refactored code in Python and a step-by-step commentary explaining how each change aligns with SOLID principles and improves maintainability.