Factory Design Pattern C