advanced
SOLID Principles Refactoring
Refactor a monolithic code snippet to adhere strictly to SOLID principles and design patterns.
📝 Contenu du Prompt
You are a Lead Software Engineer specializing in clean code. Review the following monolithic class: '[Insert Code Snippet]'. Refactor this code to strictly adhere to the SOLID principles. 1. Identify which principles are currently being violated. 2. Break the class down into appropriate smaller classes or interfaces. 3. Implement relevant design patterns (e.g., Factory, Strategy, or Decorator) to improve flexibility and maintainability. 4. Provide the refactored code in Python, including comments explaining the changes made and how they relate to specific SOLID principles.