Before doing so, however, this chapter briefly discusses
the advantages of the OOP development model.
164 CHAPTER 6 ?– O BJECT-ORIENTED PHP
?– Note While this and the following chapter serve to provide you with an extensive introduction to
PHP??™s OOP features, a thorough treatment of their ramifications for the PHP developer is actually worthy
of an entire book. Conveniently, Matt Zandstra??™s PHP Objects, Patterns, and Practice, Second Edition
(Apress, 2007) covers the topic in considerable detail, accompanied by a fascinating introduction to
implementing design patterns with PHP and an overview of key development tools such as Phing, PEAR,
and phpDocumentor.
The Benefits of OOP
The birth of object-oriented programming represented a major paradigm shift in
development strategy, refocusing attention on an application??™s data rather than its
logic. To put it another way, OOP shifts the focus from a program??™s procedural events
toward the real-life entities it ultimately models. The result is an application that
closely resembles the world around us.
This section examines three of OOP??™s foundational concepts: encapsulation,
inheritance, and polymorphism. Together, these three ideals form the basis for the
most powerful programming model yet devised.
Encapsulation
Programmers enjoy taking things apart and learning how all of the little pieces work
together.
Pages:
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243