Factory creates objects of different types