🏠 Trang chủ
Benchmark
📊 Tất cả benchmark 🦖 Khủng long v1 🦖 Khủng long v2 ✅ Ứng dụng To-Do List 🎨 Trang tự do sáng tạo 🎯 FSACB - Trình diễn cuối cùng 🌍 Benchmark dịch thuật
Mô hình
🏆 Top 10 mô hình 🆓 Mô hình miễn phí 📋 Tất cả mô hình ⚙️ Kilo Code
Tài nguyên
💬 Thư viện prompt 📖 Thuật ngữ AI 🔗 Liên kết hữu ích
Advanced

Legacy Code Refactoring Strategy

#refactoring #software-engineering #java #clean-code #design-patterns

Develop a refactoring plan for a 'God Class' in a legacy Java codebase to improve testability and adherence to SOLID principles.

You have inherited a legacy Java application containing a class named 'TransactionManager' that is 4000 lines long. It handles database connections, HTTP requests, logging, business logic validation, email notifications, and file parsing. It has 50 public methods and relies heavily on static utility classes. 1. Propose a step-by-step refactoring strategy to break this class down without breaking existing functionality. 2. Identify which SOLID principles are currently being violated. 3. Suggest specific Design Patterns (e.g., Strategy, Factory, Decorator) to apply during the refactoring process. 4. Write pseudo-code or actual Java code snippets showing how you would extract the 'email notification' logic into a separate component and inject it.