suppose you have a situation in which you have a abstract class and there are three concrete extensions of that abstract class and you want to have a class which according to a parameter will return any one of the concrete implementations.In that case factory comes into picture.Suppose i pass to the factory that i need the class with id = 1 , in that case the factory will create the object of the calss with id =1 using reflection and then return.