Join Jon Peck for an in-depth discussion in this video What you should know, part of Object-Oriented Programming with PHP.
- View Offline
This course was written with the assumption that you have some basic knowledge with PHP, and have written a few scripts. Without this knowledge, you are probably going to have a hard time following along. If you need a refresher, I recommend PHP with MySQL Essential Training with Kevin Skoglund here in the Lynda.com Online Training Library. While you should have some PHP knowledge, you're not going to need object-oriented experience. If you'd like to explore object-oriented programming at a higher level, including some of the underlying theories, I recommend Foundations of Programming: Object-Oriented Design with Simon Allardice here in the Lynda.com Online Training Library.
In this course, we'll be building a simple application that stores physical addresses. It will be incremental development, starting with just a simple address, then building out to the point where the address can display itself, load from the database, and much more. There will be three types of addresses: residences, businesses, and parks. And, each is going to have unique behaviors. I'll also demo several design patterns that solve common programming problems. At the end, you'll have a stand-alone component that could be integrated into a larger application, along with new strategies and tools at your disposal.
But let's not get ahead of ourselves. We'll start with an introduction to object-oriented programming.
- Historical overview of object-oriented PHP
- Defining classes
- Creating a method/object context with $this
- Accessing classes without instantiation
- Creating a database class
- Extending and abstracting classes
- Cloning and comparing objects
- Error handling with exceptions
- Implementing design patterns, such as the factory and strategy patterns