// archives

Archive for December 15th, 2009

A PHP Factory Pattern Example

Recently I was challenged on the fly to come up with an example of a factory pattern. Here is the result: /** * Database Connection Example * @author randymelder */ interface DatabaseConnection { function connect(); } class MySQLDatabaseConnection implements DatabaseConnection { var $link; var $user; var $pass; var $host; function __construct($host,$user,$pass) { $this->user = $user; [...]

 

December 2009
S M T W T F S
« Sep   Jan »
 12345
6789101112
13141516171819
20212223242526
2728293031