Factory Pattern example