1.2. What Design Patterns Are Not

It's important to rein in the explanation of Design Patterns by also talking about what they don't encompass. Up until now, you may have noticed that I've created a pretty large umbrella of coverage for the Design Pattern definition.

1.2.1. Design Patterns Are Not Plug and Play

If you're expecting to flip to the Design Pattern pages of this book and see full examples that you can quickly copy and paste for your next project, you will be sadly disappointed. Design Patterns are not just a simple plug and play solution to your programming project.

Design Patterns are not the actual implementation or even the algorithm for solving the problem. For example, you may create a design such that every house you construct has windows in the south to let in more heat and light. You are not actually doing the constructing with exact measurements and locations of the windows. You just hand over your design to the builder (programmer in our case), and they implement it.

Another analogous way to view Design Patterns is to compare them to musical notes on a scale. You may know all the notes in a minor scale, but playing them exactly in order and in the same tempo does not make an enjoyable song. You can't open up a scale book, grab the scale, play it on guitar, and expect everyone to think you're an amazing song writer. It would be quite boring and wouldn't solve the problem your music is made for: to demonstrate a specific set of emotions via art. In this way, ...

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.