Advanced
Legacy Code SOLID Transformation
Refactor a hypothetical monolithic class structure into a SOLID-compliant object-oriented design.
📝 Contenu du Prompt
Act as a Principal Software Engineer. You are presented with a monolithic 'UserManager' class that handles database connections, password hashing, email notifications via SMTP, and UI validation logic. Describe the step-by-step refactoring process to transform this class into a design that strictly adheres to the SOLID principles. For each step, identify the specific principle being violated (e.g., Single Responsibility) and propose a design pattern (e.g., Factory, Strategy, Dependency Injection) to resolve it, detailing how the separation of concerns improves maintainability.