Apply SOLID principles
Evaluate code against all five SOLID principles and provide a refactored version that fixes each violation with a brief rationale.
Preview
Copy prompt
Review the following code against all five SOLID principles: [Paste code]. For each principle — Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion — state whether it is violated in the current code, point to the exact problematic code, and demonstrate a refactored version that correctly applies the principle. Include a brief explanation of the benefit each change brings.
More
Refactoring
Prompts
