PHP
  Home arrow PHP arrow Caching Result Sets in PHP: Object Interaction Within a Caching System
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

Caching Result Sets in PHP: Object Interaction Within a Caching System
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 5
    2005-10-17


    Table of Contents:
  • Caching Result Sets in PHP: Object Interaction Within a Caching System
  • The first link in the caching process: looking at the “Cache” class
  • The second link in the caching process: overview of the “MySQL” class
  • The third link in the caching process: a quick look at the “Result” class
  • Chaining the links: putting the classes together

  • 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


    Caching Result Sets in PHP: Object Interaction Within a Caching System
    ( Page 1 of 5 )

    In this article, we work directly with a standalone caching class, showing how it interacts with other objects. We will work with aggregation and composition to achieve our goals, which include implementing a time expiry based caching mechanism.

    Here you have it. This is the fourth part of the series “Caching result sets in PHP.” Through the previous article, we went a long way, by developing an extensible result set caching class, which is aimed specifically at reducing one of the most common workloads often associated with database-driven websites: repetitive query execution.

    We arranged that, after performing regular SELECT statements, the obtained result set is stored in a simple cache file for faster retrieval. While the logic involved in caching result sets has been utilized for quite a long time, the different approximations for tackling this issue are certainly numerous.

    However, when we’re working on large projects, an object-oriented solution probably is best for managing all of the problems that arise, due mainly to the huge size of applications. And definitely, a caching system is yet another piece within the development environment that can be easily addressed through the object-oriented paradigm.

    According to this concept, I’ve hopefully demonstrated that a caching class may be created without the need to get too deep into complex programming definitions. Although following the practical approach may lead quickly to developing simple applications, I firmly recommend being armed with the proper theory and then using it to deploy well-structured projects.

    It seems that we’re not very close to working directly with a caching class. Well, I don’t think so. If we step back to the previous article, certainly we’ve developed such a class. However, it’s rather conceived as a programming object that interacts with at least two additional objects, and not as a standalone class.

    Therefore, we need to complete the scenario, not only showing how the class may be correctly implemented, but how the additional classes interact with each other.

    Are you feeling inclined to work with aggregation and composition? All right, let’s get started.



     
     
    >>> 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 4 Hosted by Hostway
    Stay green...Green IT