advanced
SOLID Principles Refactoring Challenge
Refactor a legacy code snippet to strictly adhere to SOLID principles and clean architecture standards.
📝 Contenu du Prompt
Act as a Senior Software Architect. You are provided with a legacy, monolithic function that handles user registration, payment processing, and email notification all in one block. Your task is to refactor this hypothetical code (describe the structure as pseudocode if no code is provided) into a modular, object-oriented structure. 1. Separate concerns into distinct classes following Single Responsibility Principle. 2. Define interfaces for dependencies to follow Dependency Inversion Principle. 3. Explain how the Open/Closed Principle is applied to allow for new payment methods without modifying existing code. 4. Provide the architectural diagram description.