PHP
  Home arrow PHP arrow Using Recursive Methods in Object-based PHP Applications
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Using Recursive Methods in Object-based PHP Applications
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 6
    2006-05-08


    Table of Contents:
  • Using Recursive Methods in Object-based PHP Applications
  • Applying recursion in object-oriented programming: creating object-based web page elements
  • Defining a recursive method: creating a web page generator class
  • A final example of recursion: creating a template processor class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using Recursive Methods in Object-based PHP Applications
    ( Page 1 of 4 )

    Welcome to the second tutorial of the series “Recursion in PHP.” Comprised of three parts, this series introduces the fundamentals of recursion in PHP, including the definition and use of recursive functions in procedural PHP scripts, as well as the creation of recursive methods in object-oriented Web applications.

    Introduction

    Just in case you don’t remember, in the first article of the series, I explored the basics of recursion, highlighting its benefits and drawbacks, in this way providing an in-depth explanation of how recursive functions work internally. To sustain the underlying theory, I showed numerous hands-on examples, which hopefully demonstrated that defining recursive functions to solve specific programming issues is not only easy, but also instructive and educational.

    As I stated in the previous article, sometimes recursion can be used when writing functions and methods aimed at navigating tree structures or linked lists. Also, even when recursion is considered an advanced approach for addressing specific problems (instead of using traditional iteration), it should be utilized with caution. It introduces significant overhead in server memory, and eventually can slow down certain applications.

    Now, in this second part of the series, I’ll explore some advanced uses of recursion in PHP, particularly in the terrain of object-oriented programming. I will develop a couple of object-based applications which use recursive methods for accomplishing their tasks. By the end of this tutorial, you should have a pretty solid grounding in how to define recursive methods within your own PHP classes.

    With the formalities out of the way, it’s time to leap forward and continue learning more about how to use recursion in PHP. Let’s go!



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

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT