🏠 Início
Avaliações
📊 Todos os Benchmarks 🦖 Dinossauro v1 🦖 Dinossauro v2 ✅ Aplicações To-Do List 🎨 Páginas Livres Criativas 🎯 FSACB - Showcase Definitivo 🌍 Benchmark de Tradução
Modelos
🏆 Top 10 Modelos 🆓 Modelos Gratuitos 📋 Todos os Modelos ⚙️ Kilo Code
Recursos
💬 Biblioteca de Prompts 📖 Glossário de IA 🔗 Links Úteis
advanced

Refactor Spaghetti Code into SOLID Principles

#coding #refactoring #architecture #design-patterns

Analyze a poorly structured monolithic function and refactor it into a modular architecture adhering to SOLID principles.

You are a Senior Software Engineer specializing in clean code and architectural design. Analyze the following legacy code snippet which suffers from tight coupling, god object anti-pattern, and lack of abstraction. Refactor the code into a language-agnostic pseudo-code structure that adheres strictly to SOLID principles. Specifically, break it down into distinct classes with clear responsibilities, utilize dependency injection where appropriate, and implement design patterns (such as Strategy or Factory) to eliminate conditional logic sprawl. Provide the refactored architecture and a brief explanation of how each SOLID principle is applied in your solution.