🏠 홈
벤치마크
📊 모든 벤치마크 🦖 공룡 v1 🦖 공룡 v2 ✅ 할 일 목록 앱 🎨 창의적인 자유 페이지 🎯 FSACB - 궁극의 쇼케이스 🌍 번역 벤치마크
모델
🏆 톱 10 모델 🆓 무료 모델 📋 모든 모델 ⚙️ 킬로 코드 모드
리소스
💬 프롬프트 라이브러리 📖 AI 용어 사전 🔗 유용한 링크
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.