© Kelt Dockins 2017

Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_10

10. Bridge

Kelt Dockins

(1)Dolph, Arkansas, USA

$> git checkout bridge

Intent

Decouple an abstraction from its implementation so that the two can vary independently.1

Applications

What does it mean to decouple an abstractionfrom its implementation? To show an example of this, let’s imagine that you want to send a message. A message is an abstraction. However, there are many different ways you can send a message. You can e-mail it; send it as a letter in the mail; speak it out loud from the rooftops; post it to Facebook, Twitter, or some other web site; put it in a bottle and drop it in the ocean; or fly a banner behind an airplane. Heck, there is even ...

Get Design Patterns in PHP and Laravel 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.