Source for file Factory.class.php

Documentation is available at Factory.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 Factory
  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.  * Factory Pattern Interface
  22.  * 
  23.  * A Factory is responsible for creating new objects.  It is responsible
  24.  * for knowing how to instantiate a class.  A Factory should define the value
  25.  * to be passed through the 'name' argument.  All Factories should check if the
  26.  * class implements the Singleton interface.
  27.  *
  28.  * @category Gumbo
  29.  * @package Factory
  30.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  31.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  32.  * @author Michael Luster <mluster79@yahoo.com>
  33.  * @link http://sourceforge.net/projects/phpgumbo
  34.  * @desc Factory Pattern Interface
  35.  * @version 0.0.1
  36.  */
  37.  
  38.     
  39.     /**
  40.      * Returns an instantiated object.
  41.      * 
  42.      * The first argument is either the name of the Class, or a key
  43.      * reference to a Class (string|int).  It will depend on the Factory as to
  44.      * what type of argument is required.
  45.      * 
  46.      * In some cases, the method will accept additional arguments.  Each
  47.      * will be passed to the Constructor in the order they are given.  It
  48.      * is important to follow the rules defined by the Factory, passing
  49.      * the appropriate arguments for the classes it instantiates.
  50.      * 
  51.      * @param string|int$name name of Class or key string
  52.      * @param mixed $args additional arguments
  53.      * @return StdClass 
  54.      */
  55.     public function factory ($name=null$args=null);
  56.     
  57. }
  58.  
  59. ?>