Prev | Current Page 260 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"


This chapter builds on that foundation by introducing several of the more advanced
OOP features that you should consider once you have mastered the basics. Specifically,
this chapter introduces the following four features:
Object cloning: One of the major improvements to PHP??™s object-oriented model
in version 5 is the treatment of all objects as references rather than values. However,
how do you go about creating a copy of an object if all objects are treated as references?
By cloning the object.
Inheritance: As discussed in Chapter 6, the ability to build class hierarchies through
inheritance is a key concept of OOP. This chapter introduces PHP??™s inheritance
features and syntax, and it includes several examples that demonstrate this key
OOP feature.
Interfaces: An interface is a collection of unimplemented method definitions and
constants that serves as a class blueprint. Interfaces define exactly what can be
done with the class, without getting bogged down in implementation-specific
details. This chapter introduces PHP??™s interface support and offers several examples
demonstrating this powerful OOP feature.
Abstract classes: An abstract class is a class that cannot be instantiated. Abstract
classes are intended to be inherited by a class that can be instantiated, better known
as a concrete class. Abstract classes can be fully implemented, partially implemented,
or not implemented at all.


Pages:
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272