Because of four authors, the book was introduced
as written by Gang of Four or simply Goff. In that legendary book, Gang of Four
introduced several patterns to minimize the amount of code as well as to introduce
effective coding practice. In this chapter we will learn some of those patterns to
implement in PHP.
You Might have Done this Before??¦
While coding, many of us use these patterns without being aware that these
techniques are actually known as patterns. Even in my early coding life, I used some
coding techniques, which I later found out to be similar to some patterns. So don't
be afraid about using patterns. They are daily coding tricks, which you may have
always performed, but you may not have known.
While developing software, some problems are addressed on a regular basis. Almost
every software development faces some of these problems. These problems are
termed "design patterns" and are given some common solutions. So knowing design
patterns saves a lot of time for developers in software development. Let's have a
closer look at design patterns.
Design Patterns
[ 68 ]
Strategy Pattern
One of the common problems we face whilst programming, is that we have to
make decisions on different strategies.
Pages:
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90