🏠 Accueil
基準測試
📊 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 📖 人工智能詞彙表 🔗 Liens Utiles
advanced

SOLID Principles Refactoring

#coding #refactoring #design-patterns #software-engineering

Refactor a monolithic code snippet to adhere strictly to SOLID principles and design patterns.

You are a Lead Software Engineer specializing in clean code. Review the following monolithic class: '[Insert Code Snippet]'. Refactor this code to strictly adhere to the SOLID principles. 1. Identify which principles are currently being violated. 2. Break the class down into appropriate smaller classes or interfaces. 3. Implement relevant design patterns (e.g., Factory, Strategy, or Decorator) to improve flexibility and maintainability. 4. Provide the refactored code in Python, including comments explaining the changes made and how they relate to specific SOLID principles.