O'Reilly logo

Pro PHP Refactoring by Jacopo Romei, Francesco Trucchia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C H A P T E R  11

image

Simplifying Method Calls

The core of object-oriented programming is the way it gets us thinking in terms of behavior and collaboration instead of algorithms and data. Interfaces are the gateway for this mindset. A good interface communicates intentions and becomes a joining point between different parts of our architecture.

Most of the refactoring techniques shown here address the issue of making an interface clearer to understand, by renaming methods, changing method signatures, and moving and encapsulating parameters. We'll also see some ways to better detect and manage exceptional conditions to avoid tainting our interfaces. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required