Source for file Flyweight.class.php

Documentation is available at Flyweight.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Flyweight
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Flyweight Interface
  22.  * 
  23.  * This interface is modeled after the Flyweight Design Pattern.  When many
  24.  * objects must be manipulated but the program cannot afford to have extraneous
  25.  * data, the Flyweight should be used.  The idea works similar to a Factory,
  26.  * except it saves the object internally.  This can be used later in the program
  27.  * when the same object type is needed.
  28.  *
  29.  * @category Gumbo
  30.  * @package Flyweight
  31.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  32.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  33.  * @author Michael Luster <mluster79@yahoo.com>
  34.  * @link http://sourceforge.net/projects/phpgumbo
  35.  * @desc Flyweight Interface
  36.  * @version 0.0.1
  37.  */
  38.  
  39.     
  40.     /**
  41.      * Returns the object reference passing the data
  42.      * @param mixed $data data to populate the object (varies based on implementing Class)
  43.      * @return StdClass varies based on implementing Class
  44.      */
  45.     public function get ($data=null);
  46.     
  47. }
  48.  
  49. ?>