DeepSeek Prompt for DeepSeek Optimized
A DeepSeek-optimized refactoring prompt to improve raw SQL to ORM patterns in a Java task management app codebase.
More prompts for DeepSeek Optimized.
Uses DeepSeek to analyze system architectures and identify performance bottlenecks, scalability issues, and optimization opportunities.
A DeepSeek-optimized refactoring prompt to improve monolith to modular in a Java learning management system codebase.
A DeepSeek-optimized debugging prompt for identifying and fixing data corruption issues in a TypeScript job board.
A DeepSeek-optimized refactoring prompt to improve single tenant to multi-tenant in a Java survey builder codebase.
A DeepSeek-optimized debugging prompt for identifying and fixing database query optimization issues in a TypeScript learning management system.
A DeepSeek-optimized refactoring prompt to improve single tenant to multi-tenant in a Python survey builder codebase.
Guide me through refactoring raw SQL to ORM patterns in my Java task management app project. **Leverage DeepSeek strengths:** Refactoring requires understanding existing code deeply, reasoning about design trade-offs, and generating clean replacement code, all areas where you excel. **Tech stack:** Laravel + PHP **Developer context:** junior developer ## Refactoring Plan ### Phase 1: Assessment Before changing anything, assess the current state: - What code smells indicate that raw SQL to ORM patterns refactoring is needed? - How to measure the current code quality (metrics, complexity scores) - Identify all files and modules affected by this refactoring - Map the dependencies that could be impacted - Define "done" criteria: what does the code look like after successful refactoring? ### Phase 2: Strategy Selection Present 2-3 refactoring strategies for raw SQL to ORM patterns: For each strategy: - Approach description and rationale - Design patterns to apply (with Java code examples) - Effort estimate (small/medium/large) - Risk level and mitigation plan - Incremental vs. big-bang trade-offs - Recommend the best strategy with justification ### Phase 3: Safety Net Before refactoring, ensure safety: - Test coverage requirements for the affected code - Example test cases in Java that should pass before AND after refactoring - Feature flags or gradual rollout approach - Rollback strategy if issues arise - How to validate behavior preservation ### Phase 4: Step-by-Step Refactoring Break the refactoring into small, safe steps: For each step: 1. What to change and why 2. The before code snippet in Java 3. The after code snippet in Java 4. Tests to run after this step 5. What to verify before moving to the next step ### Phase 5: Advanced Improvements After the core refactoring, suggest additional improvements: - SOLID principle violations to address - Opportunities to leverage Java-specific features - Performance optimizations unlocked by the new structure - Better error handling patterns - Improved type safety and interfaces ### Phase 6: Verification - Run the full test suite and resolve any failures - Performance benchmarks before and after - Code complexity metrics comparison - Code review checklist for the refactored code - Documentation updates needed Provide real, compilable Java code throughout. Each step should leave the codebase in a working state so the refactoring can be paused and resumed safely.