This explains the basic of Factory Design pattern.