Facade pattern in PHP

The facade pattern is today’s structural design pattern. My previous two blogs were about the adapter and the decorator patterns and just like these pattern, the facade pattern is also a known as a wrapper.

The facade pattern does have some similarities to the adapter pattern, in that they’re both used to modify the interface of an entity. However the decorator pattern is used in a very different manner. In case you forgot, here is a quick run down.

Pattern Purpose
Adapter Used to allow incompatible interfaces to work together.
Decorator Allows behaviours to be added to an object, without modifying the original class.
Facade Provides a simplified interface to a more complex library.

Continue reading