PHP
  Home arrow PHP arrow An Introduction to Building Proxy Clas...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
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

An Introduction to Building Proxy Classes with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2007-01-02

    Table of Contents:
  • An Introduction to Building Proxy Classes with PHP 5
  • Developing an expandable XML processor class
  • Expanding the functionality of the ProxyXMLProcessor class
  • Defining the XMLProcessor class
  • Seeing the proxy class in action

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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


    An Introduction to Building Proxy Classes with PHP 5


    (Page 1 of 5 )

    If you create object-oriented programs in in PHP 5, you know that their performance can be improved by rationalizing the use of objects. The proxy pattern can help with this task. In this first of a two-part series, you will learn the key points of how to use this pattern with PHP 5.

    Introduction

    During your life as PHP developer, quite possibly you'll have learned some useful approaches to improve the overall performance of object-based web applications. From using content/XHTML caching mechanisms and compressing web page outputs, to implementing a rational usage of the objects utilized by a given application, options are numerous. Logically, the best of this variety of possible improvements rests on the point that many of the methods I mentioned can be used in conjunction with applications that have been written using a procedural methodology.

    Nevertheless, when it comes to working solely with object-oriented programs in PHP, it's possible to create applications that present a carefully-planned utilization of their different objects. One of the simplest approaches, implemented to avoid the duplication of costly objects, involves using the popular references in PHP 4 instead of working with multiples copies of the objects in question.

    However, if you're looking for new techniques aimed at improving the performance of object-based PHP applications as a whole, I must say that there's more good news on the horizon: in the huge terrain of creational design patterns, there's one that can be used successfully for implementing a rational usage of objects. In this case, I'm referring specially to the proxy pattern, which offers many interesting features that can help to reduce significantly the overhead of an application.

    But I'm sure you're wondering how this pattern works. Well, in short, in the proxy pattern, one object is created by another only when the functionality of the first one is required. This avoids unnecessary class instantiation. For this pattern in particular, the object called "proxy" is responsible for handling all the accesses to another class, something that looks very similar to the behavior of different proxy servers. Now, are you feeling more familiar with the functionality of this useful pattern? I'm sure you are.

    Having introduced the basic definition of proxy objects in PHP, in this two-part series, I'm going to walk you through the key points of how to use this pattern with PHP 5, as well as how to apply it in different real-world situations.

    With the preliminaries out of our way, let's start learning more about this handy design pattern. Let's go!

    More PHP Articles
    More By Alejandro Gervasio


       · Over this first part of this series, you'll learn the basic concepts on how to...
     

       

    PHP ARTICLES

    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway