concept design pattern in category php

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.
The evolution of software engineering and methodology since 1990 has transformed object-oriented from buzzword to household word (in programmer households, that is). During this time, there have also been some conceptual innovations and shifts in the object-oriented paradigm. Design patterns have become widely popular. The idea of using objects to model real-world entities has been modified or deemphasized. And the concepts of agile development have become acceptable even in polite society. PHP 5 is an attempt to incorporate some of these ideas into PHP.
In this section, we will get an overview of the most important ideas in agile development and object-oriented design. We will introduce design patterns, refactoring, and unit testing, take a look at how and why they work and how they fit together, and begin to see how they can be implemented in PHP.
Much of the literature on software design nowadays focuses on design patterns. Design patterns are an attempt to make the principles of good object-oriented design more explicit. Patterns are defined as “a recurrent solution to a problem.” But using them is not as simple as following a cookbook recipe. Applying a pattern can be daunting, since the description in a book is usually somewhat abstract and you have to figure out how exactly to use it in a situation that is different from the example given in the book.
As we’ve already hinted, an even greater challenge is discovering when you have the problem that the pattern is supposed to solve. Unless your requirement is extremely similar to an example you’ve seen, it’s seldom obvious. And there are lots of situations in which you can use a design pattern but would be better off not doing it because you don’t need the extra flexibility that the pattern provides. For instance, the book Design Patterns [Gang of Four] describes a pattern called Command, which involves creating an object-oriented class for each type of command in your program. So if you have an Edit command, you write a class called EditCommand and when you want to run the command, you instantiate the class and run a method that does whatever the command is supposed to do: