8.1. Problem and Solution

A reoccurring theme throughout this book seems to be making an effort to remove complexity from the code. But, it's not necessarily complexity in code that we're trying to remove. It's the coupling of different objects that is the aim of this simplicity. Project architects should tip their hat to the programmer of a complex subsystem, appreciate its complexity, quality, and execution, and then plug it into their overall project. As interior component logic becomes more complex, however, the exterior interaction seems to follow suit. The goal of the Façade Design Pattern is to rein in the exterior intricacies and provide a simple interface to harness the power of said component. What makes the Façade Design Pattern unique is that it's designed to combine or couple multiple related components into that simple usable interface.

Put into more practical terms, Façade Design Pattern-based classes may provide a public interface to execute a logical business request. This individual business request may require multiple technical logic steps to be executed in order to complete. Business processes are not always as simple as their name implies. For example, the process may be titled "Make Shared Files Available on Network." From their point of view, the programmer knows that they must execute the following technical processes: "Create File Share," "Move File to File Share," and "Apply Proper Permissions to File." The Façade Design Pattern provides that interface ...

Get Professional PHP Design Patterns 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.