🏠 Accueil
Benchmarks
📊 Tous les Benchmarks 🦖 Dinosaure v1 🦖 Dinosaure v2 ✅ To-Do List Apps 🎨 Pages Libres 🎯 FSACB - Showcase 🌍 Traduction
Modèles
🏆 Top 10 Modèles 🆓 Modèles Gratuits 📋 Tous les Modèles ⚙️ Modes Kilo Code
Ressources
💬 Prompts IA 📖 Glossaire IA 🔗 Liens Utiles
advanced

Refactoring a Monolithic God Object

#refactoring #clean-code #solid-principles #design-patterns

Develop a step-by-step refactoring strategy to break down a massive, tightly-coupled class into modular components.

You are presented with a legacy 'OrderManager' class containing 15,000 lines of code. It handles database connections, business logic, email notifications, logging, and UI formatting. Create a detailed refactoring plan to decompose this class into a modular architecture adhering to SOLID principles. Your plan should include: 1) Identification of distinct responsibilities and the suggested new classes/interfaces. 2) A strategy for extracting methods without breaking existing functionality, including specific unit tests to write before extraction. 3) The use of design patterns (e.g., Strategy, Factory, Observer) to replace complex conditional logic. 4) A migration path that allows the system to remain functional incrementally throughout the process.