View Single Post
Old 08-06-2008, 04:01 PM   #1 (permalink)
Jenski
The Wanderer
 
Join Date: Apr 2008
Location: Cloud 9
Posts: 19
Thanks: 0
Jenski is on a distinguished road
Help Object Aggregation

I'm using a Database Connection class in a web app I am writing as I find myself calling the same functions often.

I was looking into using Aggregation in order to achieve this when I came across this article:

Page 2 - Object Interaction in PHP: Introduction to Aggregation, part 1

But it says:

Quote:
If we talk about performance issues, the advantages of aggregation mainly come from its lower overload, since most of the time only one object is shared by other objects. However, this advantage might be discarded in the case of having a class for database connection shared by other multiple classes. You may run into difficulties if multiple database connections are established to the same server, causing a noticeable detriment to the system, particularly if your site is attracting many visitors.
I was wondering if I could get around this using PHP5s features by cloning the object then unsetting it each time i'm using it, or if there any other alternatives?

Thanks

Jen
Jenski is offline  
Reply With Quote