Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

phpPatterns:
The Factory Method
May 01, 2003 @ 14:17:43

So what is "The Factory Method"? Well, as the article says... "The factory method is a creational method; a method in a class (or even just a PHP function) which returns instances of new classes." This article also goes as far as to describe layering within a class.

I found this article to be fairly helpful in explaining the returning of new objects. This can be especially helpful if you are using PHP-GTK. The article also gives a little example on using it with a MySQL database. Anyway, hope this is of some use to all of you.

tagged:

Link:


Trending Topics: