O'Reilly logo

PHP in Action: Objects, Design, Agility by Chris Shiflett, Marcus Baker, Dagfinn Reiersol

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Design patterns

7.1 Strategy 125
7.2 Adapter 128
7.3 Decorator 135
7.4 Null Object 139
7.5 Iterator 142
7.6 Composite 145
7.7 Summary 151

Not long ago, I was trying to get my son, age five, to ski. It started well: he saw his older sister skiing down a mild slope, and immediately became eager to show us how easily he could do the same thing.

He couldn’t, though. He insisted on putting his skis on in the middle of the slope, and immediately fell flat on his back. I told him it was a nice try, but he disagreed. He had simply lost all interest. I suggested we go lower where it was less challenging. Instead he insisted on going to the top. I humored him and we went up. He had one look down the slope and said, “It’s scary.”

Of course ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required