tri_inn
i understand the both factory and factory method pattern. in factory pattern we create instance of my classed by another class function dynamically where i pass some parameter to another class function and based on that parameter another class function return right instance of class.
in factory method pattern we have to proceed one further step. in factory method pattern subclass create instance of my class. i do not find a scenario where people has to go for factory method pattern. so please some one come with a scenario where normal factory pattern will not be used rather people prefer to use factory method pattern.
here i am posting two set of code first one done by factory pattern and second one done by factory design pattern
1st set of code where factory pattern used
Calling this way
now same thing done by factory method pattern where i have to write more code to get the job done
calling like this way