The Flyweight Pattern in PHP 5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FluffyCat

    The Flyweight Pattern in PHP 5

    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.
Working...