Advanced
Refactor God Object to SOLID Principles
Refactor a monolithic class structure into a modular design adhering to SOLID principles.
📝 Contenu du Prompt
You are provided with a conceptual description of a 'UserManager' class that handles database connections, email sending, logging, authentication, and UI notifications within a single 2000-line file. Refactor this 'God Object' into a modular architecture adhering strictly to SOLID principles. Define the interfaces and concrete classes required (e.g., UserRepository, EmailService, NotificationService, AuthService). Explain how Dependency Injection would be implemented to wire these components together and how this design improves testability and maintainability.