advanced
Spaghetti to SOLID
Plan a refactoring strategy for a monolithic legacy module.
📝 Nội dung Prompt
Analyze the following description of a poorly designed legacy module: A 5000-line class 'OrderProcessor' that handles validation, database connection, email notifications, and logging using static methods. Provide a step-by-step refactoring plan to break this class down according to SOLID principles. Specifically, explain how you would implement Dependency Injection to decouple the database access and apply the Strategy pattern to handle different notification types (Email vs. SMS) without changing the existing business logic flow.