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. ...

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.