The Flyweight Pattern in PHP 5

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Yesterday I continued my series of design patterns examples using PHP
5 with the Bridge Pattern.  Here now is my 18th design pattern
example, the Flyweight Pattern.

In the flyweight pattern we conserve resources by sharing instances of
a class which are identical.

The creating of these instances is controlled by a factory which will
only create one if it does not already exist, and will return the
shared instance to the requestor.

Site Timeline