An example of the Simple Factory design pattern dones as a tutorial from http://wp.tutsplus.com/tutorials/creative-coding/design-patterns-in-wordpress-the-simple-factory-pattern/.