Gumbo_Factory



Generic Factory Class

The class will return an object of the defined Class Name. It will automatically determine if the class uses the Singleton interface. It will pass arguments in the order they appear, but only through the 'new ClassName (..)' call.

The Factory class returns any instance of an object, or null if any failures occur. This class can be easily extended by other Factories. The child factory would override the 'factory' method to perform specific operations on the input sent by the client. It would call the parent (Gumbo_Factory) factory method to get a new object. If the returned results are 'null', the child class would be able perform any extra processing before returning to the client.

Author(s): Michael Luster <mluster79@yahoo.com>
License:New BSD License
Copyright:Copyright (c) 2007, iBayou, Michael Luster
Link:http://sourceforge.net/projects/phpgumbo
Version:0.0.1

Implements interfaces:

Child classes:

Class Methods

public StdClass factory ( [string $name], [mixed $args] ) [line 61]

Returns an instantiated object.

Each additional argument will be sent to the Constructor of the Object in the order as it appears.

Parameter(s):

  • (string) $name :: name of the class
  • (mixed) $args :: additional arguments
  • precondition:  class_exists()
  • throws:  Gumbo_Exception
Overridden in child classes as:
Gumbo_Converter::factory()
Returns an instantiated object (accept Constructor arguments)
Gumbo_Debug_Server::factory()
Returns a Debug Server Report
Gumbo_Filter::factory()
Returns an instantiated object (accepts Constructor arguments)

Implementation of:
Gumbo_Interface_Factory::factory()

[ Top ]