In the world of PHP development, we often find ourselves facing the challenge of dealing with bloated, monolithic classes that hinder testability, extensibility, and maintainability. This talk aims to guide PHP developers through the process of overcoming the problem of unwieldy classes by employing effective structuring, refactoring techniques, and industry best practices.
13. Problems
- They do too much
Long functions
- They hold too much
- Difficult to read, maintain and extend
- Responsibility is too wide
- Violates SRP
14. Problems
- Familiar parts of code in several places
Code duplication
- Need to apply the changes in several places
- Forged to apply somewhere - inconsistent system
- Leads to bugs
17. Problems
- No standards for a structure
Poor structure
- Difficulty in Understanding
- Maintenance Challenges
- Reinvent the wheel
18. Problems
- No documentation
Bad documentation
- Outdated documentation
- Difficult to understanding the system
- Onboarding Challenges
- Maintainability issues
19. Problems
- Difficult to understand
Lack of modularity
- Difficult to extend
- Difficult to maintain
27. 4. Make it platform agnostic
2. Understand responsibilities
3. Split by purpose
6. Documentation
1. Follow Coding Standards
5. Apply Design Patterns
List of approaches
7. Cover it by Tests
49. - Docs near the code
2. Docs as Code
- Docs under version control
1. Avoid meaningless PHPDocs
3. Document interaction with integrations
Documentation
4. Architecture Decision Record