Book description
Many businesses and organizations depend on older high-value PHP software that risks abandonment because it is impossible to maintain. The reasons for this may be that the software is not well designed; there is only one developer (the one who created the system) who can develop it because he didn't use common design patterns and documentation; or the code is procedural, not object-oriented. With this book, you'll learn to identify problem code and refactor it to create more effective applications using test-driven design.
Table of contents
- Cover Page
- Title Page
- Copyright
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- CHAPTER 1: Introduction
- CHAPTER 2: Finding “Bad Smells” in Code
- CHAPTER 3: Introduction to Refactoring
- CHAPTER 4: Principles and Rules
- CHAPTER 5: Test-First Development
- CHAPTER 6: Refactoring Tools
- CHAPTER 7: Structuring Behavior
- CHAPTER 8: Changing Class Responsibilities
-
CHAPTER 9: Dealing with Data Rationalization
- Self-Encapsulate Field
- Replace Data Value with Object
- Change Value to Reference
- Change Reference to Value
- Replace Array with Object
- Change Unidirectional Association to Bidirectional
- Change Bidirectional Association to Unidirectional
- Replace Magic Number with Symbolic Constant
- Encapsulate Field
- Replacing Type Code with Subclasses
- Replace Type Code with State/Strategy
- Replace Subclass with Fields
- Summary
- CHAPTER 10: Reducing to Essential Conditional Executions
-
CHAPTER 11: Simplifying Method Calls
- Rename Method
- Add Parameter
- Separate Query from Modifier
- Parameterize Method
- Replace Parameter with Explicit Method
- Preserve Whole Object
- Replace Parameter with Method
- Introduce Parameter Object
- Remove Setting Method
- Hide Method
- Replace Constructor with Factory Method
- Replace Error Code with Exception
- Replace Exception with Test
- Summary
- CHAPTER 12: Simplifying Generalization Relationships
- CHAPTER 13: Legacy Code
- CHAPTER 14: Regression Tests
- CHAPTER 15: Refactoring with Patterns
- Index
Product information
- Title: Pro PHP Refactoring
- Author(s):
- Release date: July 2010
- Publisher(s): Apress
- ISBN: 9781430227274
You might also like
book
PHP Development Tool Essentials
Learn PHP development best practices, such as version control, development environment virtualization, and coding standards. You'll …
book
PHP 7: Real World Application Development
Use new features of PHP 7 to solve practical, real-world problems faced by PHP developers like …
book
Mastering PHP 7
Effective, readable, and robust codes in PHP Key Features [*] Leverage the newest tools available in …
book
Modular Programming with PHP 7
Utilize the power of modular programming to improve code readability, maintainability, and testability About This Book …