Hard
Advanced Legacy Code Refactoring
Refactor a monolithic function into modular, SOLID-compliant components with detailed explanations.
📝 Promptens innehåll
Analyze the following legacy code snippet which handles user authentication and session management. Identify code smells, violations of SOLID principles, and security vulnerabilities. Rewrite the code into a modern, modular architecture suitable for a microservices environment. Ensure the solution includes dependency injection, asynchronous handling where appropriate, and comprehensive error handling. Provide a step-by-step explanation of your refactoring decisions and the before-and-after comparison.