PHP
  Home arrow PHP arrow An Introduction to Building Proxy Classes with PHP 5
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

An Introduction to Building Proxy Classes with PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 8
    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:
      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


    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
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





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