advanced
Refactor Monolithic Class to SOLID Principles
Analyze a poorly designed class and refactor it to adhere to SOLID design patterns.
📝 Contenu du Prompt
You are a Senior Software Engineer. Review the following legacy code snippet which violates multiple SOLID principles. Identify specific violations in the Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion principles. Refactor the code into a modular, testable architecture using the Strategy and Factory patterns where appropriate. Provide the refactored code in Java, along with a brief explanation of how each principle was addressed.