PHP
  Home arrow PHP arrow Caching Result Sets in PHP: Object Int...
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

Caching Result Sets in PHP: Object Interaction Within a Caching System
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    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:
      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


    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


       · In this fourth part of the series, the result-set caching class is integrated with...
       · Great set of articles, it's exactly what I was looking for.I am having some...
       · Hello,Thanks for commenting on the article. Regarding your question, the reason...
       · I'm just wondering why not using PEAR :: DB instead of creating new classes for...
       · Thanks for the comments on my article and my classes.In fact, I'm not reinventing...
       · Thank you for answering back.I do see your point, but let me add this. It's true...
       · Thank you for your reply.I understand your point too. What you said about PEAR...
       · I have coded in several different languages prior to using PHP, and have more of a ...
       · I'm glad to know that this series have been quite helpul for you in learning the OOP...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - 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





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