[horde] docs on methods used in the framework

Chuck Hagenbuch chuck at horde.org
Thu Apr 19 14:51:10 PDT 2001


Quoting Nico Galoppo <scratch at ace.ulyssis.org>:

> Sorry, I think I found the (easy) answer already. The factory method
> lets you associate an object with a concrete storage method right?

Sort of... quoting directly from "Design Patterns" (great book):

Factory Method: Define an interface for creating an object, but let subclasses 
decide which class to instantiate. Factory Method lets a class defer 
instantiation to subclasses.

> So I should do the following:
> 
> $myPrefs = new Prefs;
> $myPrefs->factory('sql', $params);

No.

> Right? or rather:
> 
> $myPrefs = Prefs::factory('sql', $params);

Yes. Factory methods are static methods.

> Also, are the parameters documented somewhere, or should I dig through
> the code?

http://chuck.bitgroup.com/api/ is generated from PHPDoc every hour or so; for 
some reason it's not building the package-specific lists correctly, but if you 
stick to the main index it should work fine.

-chuck

--
Charles Hagenbuch, <chuck at horde.org>

Taurus:
You will receive an urgent transmission from the Martian government informing 
you that Mars does not, in fact, need women, so please stop sending them.




More information about the horde mailing list