There are many design patterns as well, which we cannot cover in this
book, because it would then simply be a book on just design patterns. However, if
you are interested in learning other design patterns, you can read Head First Design
Patterns published by O'reilly and Design Patterns Explained by Addison-Wesley.
Don't think that you have to implement design pattern in your code. Use them only
when you need them. Proper usage of correct patterns can make your code perform
better; similarly using them improperly could make your code slow and
less efficient.
In the next chapter we will learn about another important section of OOP in PHP.
That is Unit testing and Reflections. Until then, keep playing with the patterns and
explore them.
Reflection and Unit Testing
PHP5 brings in many new flavors compared to PHP4. It replaces many old APIs with
smarter, new ones. One of them is Reflection API. Using this cool set of API, you can
reverse engineer any class or object to figure out its properties and methods. You can
invoke those methods dynamically and do some more. In this chapter we will learn
in more detail about reflections and use of each of these functions.
Pages:
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114