Home arrow PHP arrow Caching Result Sets in PHP: The Barebones of a Caching Class

Caching Result Sets in PHP: The Barebones of a Caching Class

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.

TABLE OF CONTENTS:
  1. Caching Result Sets in PHP: The Barebones of a Caching Class
  2. Chaining things along: a quick look at the procedural caching solution
  3. The object-oriented solution: developing a result set caching class
  4. Caching with class: a deeper look at the “Cache” class
  5. More class methods in detail: ending up the round
By: Alejandro Gervasio
Rating: starstarstarstarstar / 7
October 10, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: