// archives

design pattern

This tag is associated with 1 posts

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; [...]

 

July 2010
S M T W T F S
« May    
 123
45678910
11121314151617
18192021222324
25262728293031