Benefits
reduse load on the database (if one)
object persistance, you don't have to save/load data beetwin requests (you
do but it's done internally)
easier to build distrubuted applications (if using a common repository for
multiple servers)
I use similar techniqes in caching database requests. It seems to me that PHP sorely needs what cold fusion has. A hierarcy of persistance. Let me explain.
In cold fusion you have a series of object pools.
Attributes: this execution only
session: This user, this session
client: This user any session (like a cookie but kept server side)
application: This application any user, any session
server: As long as the CF server is running, all applications, all clients, all sessions.
As far as I know CF keeps these objects in memory or the registry. It's very common for me to declare a COM object as an application variable and keep reusing it in pages without creating new instances of it with every page execution. It really speeds things up. This is especially powerful because you can cache queries this way. Run a query once save it as a server or a application variable and keep reusing it without going to the database (or disk!).
There are plenty of things I don't like about CF but I do miss this thing in PHP.
:wq
Tim Uckun
Due Diligence Inc. http://www.diligence.com/ Americas Background Investigation Expert.
If your company isn't doing background checks, maybe you haven't considered the risks of a bad hire.