🏠 Home
Prestatietests
📊 Alle benchmarks 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List applicaties 🎨 Creatieve vrije pagina's 🎯 FSACB - Ultieme showcase 🌍 Vertaalbenchmark
Modellen
🏆 Top 10 modellen 🆓 Gratis modellen 📋 Alle modellen ⚙️ Kilo Code
Bronnen
💬 Promptbibliotheek 📖 AI-woordenlijst 🔗 Nuttige links
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.