Taking legacy code from a project and task manager and refactoring.
I've been wanting to implement the refactoring techniques I've been learning, so I decided to JUST DO IT! I'll be following "Modernizing Legacy Applications" by Paul M Jones https://leanpub.com/mlaphp. I'll be adding my own notes as I go with tips or issues I run into.
- Inital file setup
- make files work as a standalone project
- include sql import for tables
- Layout style guides and other standards
- Implement An Autoloader
- PSR-0
- A Single Location For Classes
- Add Autoloader Code
- Common Questions
- Review and Next Steps
- Consolidate Classes and Functions
- Consolidate Class Files
- Consolidate Functions Into Class Files
- Common Questions
- Review and Next Steps
- Replace global With Dependency Injection
- Global Dependencies
- The Replacement Process
- Common Questions
- Review and Next Steps
- Replace new With Dependency Injection
- Embedded Instantiation
- The Replacement Process
- Common Questions
- Review and Next Steps
- Write Tests
- Fighting Test Resistance
- Setting Up A Test Suite
- Common Questions
- Review and Next Steps
- Extract SQL Statements To Gateways
- Embedded SQL Statements
- The Extraction Process
- Common Questions
- Review and Next Steps
- Extract Domain Logic To Transactions
- Embedded Domain Logic
- Domain Logic Patterns
- The Extraction Process
- Common Questions
- Review and Next Steps
- Extract Presentation Logic To View Files
- Embedded Presentation Logic
- The Extraction Process
- Common Questions
- Review and Next Steps
- Extract Action Logic To Controllers
- Embedded Action Logic
- The Extraction Process
- Common Questions
- Review and Next Steps
- Replace Includes In Classes
- Embedded include Calls
- The Replacement Process
- Common Questions
- Review and Next Steps
- Separate Public And Non-Public Resources
- Intermingled Resources
- The Separation Process
- Common Questions
- Review and Next Steps
- Decouple URL Paths From File Paths
- Coupled Paths
- The Decoupling Process
- Common Questions
- Review and Next Steps
- Remove Repeated Logic In Page Scripts
- Repeated Logic
- The Removal Provess
- Common Questions
- Review and Next Steps
- Add A Dependency Injection Container
- What Is A Dependency Injection Container?
- Adding A DI Container
- Common Questions
- Review and Next Steps
- Conclusion
- Opportunities for Improvement
- Conversion to Framework
- Review and Next Steps