PHP
  Home arrow PHP arrow Caching Result Sets in PHP: The Barebo...
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 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
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: The Barebones of a Caching Class
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2005-10-10

    Table of Contents:
  • Caching Result Sets in PHP: The Barebones of a Caching Class
  • Chaining things along: a quick look at the procedural caching solution
  • The object-oriented solution: developing a result set caching class
  • Caching with class: a deeper look at the “Cache” class
  • More class methods in detail: ending up the round

  • 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: The Barebones of a Caching Class


    (Page 1 of 5 )

    While procedural caching may be well-suited for small and even medium-sized applications, the picture changes for large projects. That's when object-oriented approaches come into their own. This article focuses on developing an object-based extensible caching solution.

    Introduction

    This is the third chapter of the series “Caching result sets in PHP.” Welcome back. If you’ve been traveling the procedural road within your PHP applications for a while, I hope that the result set caching solution developed in the second part of this series has been useful enough for you to start building an expandable caching system.

    As mentioned in previous articles that belong to this series, a procedural caching solution is potentially well-suited for small and even medium-sized applications. However, when we make a step forward to building large projects, the panorama might dramatically change, as more complex development approaches are needed.

    As you probably know, an object-oriented approximation is definitely a better solution, particularly when an application can be conceived as a set of well-defined and “pluggable” layers, where each one of them plays a specific role within the overall development context.

    Based on the key concepts indicated above, this third part of the series will be focused mainly on developing an object-based extensible caching solution, in order to take advantage of the inherent benefits related to caching results sets. In this way, PHP applications may run faster, by reducing the additional overload introduced on the server when multiple database connections are established, or many resource-consuming SQL queries are performed on a frequent basis.

    Since the object-oriented caching approximation is strongly based on a well-structured relationship between several PHP classes, hopefully the whole experience will be instructive for putting into practice different core concepts inherent to object interaction, such as aggregation and composition. If you have some small gaps within your background related to these topics, this article might help you fill them in.

    Having detailed the scenario, the challenge is now right before us. Want to try a little bit more? Fine. Let’s go!

    More PHP Articles
    More By Alejandro Gervasio


       · This part of the series goes through the makings of the basic structure for a...
       · Am I the only one who only sees part 1 and 3?
       · Hello,Thank you for commenting on the article. And regarding your question,...
       · The second part was scheduled for today, but an editing mix-up placed the third...
       · The second part of the article was published today. Here is the link...
       · Thank you very much for your easy to understand articles. I am using much code...
       · Another solution for my case would involve creating a db table named...
       · Hello,Thanks for commenting on the article. It's always nice to get your...
       · Hello again,Regarding your caching alternative, try to keep your database access...
       · Thank you for your input. It gives me a better understanding of the usage for this...
       · Hello,Thank you for the compliments on the series I wrote, and I'm glad to hear...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





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