Home arrow PHP arrow Abstract Classes in PHP: Working with PHP 5

Abstract Classes in PHP: Working with PHP 5

Here we are again. This is the tutorial youíve been waiting for! Welcome to the last part of the series ďAbstract classes in PHP.Ē If youíve already read the previous articles, then youíll know that this series introduces the basics of abstract classes in PHP 4/PHP 5, and illustrates their use and implementation in concrete situations.

  1. Abstract Classes in PHP: Working with PHP 5
  2. Working with a highly improved object model: defining abstract classes in PHP 5
  3. Calling class methods out of the object context: using the scope resolution operator
  4. Using abstract classes in PHP 5: setting up an example
By: Alejandro Gervasio
Rating: starstarstarstarstar / 50
February 08, 2006

print this article




Before I leap forward, itís worth a brief look back to remind you of what you learned during the previous installment of this series, so itíll be much easier to continue with the topics that will be discussed in this final tutorial. As youíll recall, in the second part I demonstrated how to create a well-defined hierarchy of data processing PHP 4 classes, with the base class being abstract. This originally provided a set of undefined, highly generic methods for converting data to different formats.

In consonance with the concepts deployed before, I derived two specific subclasses from the base class. These classes were responsible for processing file data, along with MySQL result sets. To achieve these tasks, each child class provided a concrete implementation for each generic method declared within the corresponding parent class. This condition demonstrated how to use a PHP 4 abstract class as the starting point from which to derive as many subclasses as needed, in order to perform concrete operations within a given PHP application.

As you know, the whole idea of defining an abstract class is to allow you to define generic characteristics of a given object (including properties and methods), and then implement a concrete functionality by using the methods of the respective subclasses. So now itís clear and fresh in your mind what abstract classes are and how to use them during the development cycle of a Web application.

That said, in this last part of the series, Iíll explain the key points of abstract classes in PHP 5, and additionally provide you with some hands-on examples. This should give you a clear idea of how to utilize them within the powerful Object Model implemented in the latest version of PHP.

Assuming that youíre interested in learning more about PHP 5 abstract classes, itís time to move forward and find out how to use them. Letís get going!

>>> More PHP Articles          >>> More By Alejandro Gervasio

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: