C H A P T E R  10

image

Reducing to Essential Conditional Executions

When designing our applications, often we limit ourselves to creating the most important classes and then we create complex conditional logic in their methods to change their behavior, based on their configuration. This approach is typical of those who used procedural programming for a long time and are accustomed to a cascading code execution, rather than designing objects that communicate with each other.

In procedural programming styles, the only way to change the behavior of code flow is with conditional logic. In object-oriented programming, in many cases, the conditional logic ...

Get Pro PHP Refactoring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.