Advanced
Legacy Code SOLID Refactoring
Identify violations of SOLID principles in a provided monolithic class and propose a refactored structure.
📝 Contenuto del prompt
Analyze the following hypothetical monolithic class named 'OrderManager' that handles database connections, email notifications, payment processing via API, and inventory logging. Identify all violations of the SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion). Propose a refactored class structure or pseudocode that resolves these violations. Specifically, explain how you would use Dependency Injection to decouple the payment processing logic from the OrderManager.