Anayonkar Shivalkar wrote:In factory pattern, we know the name of the class, and its just that we are simply interested in 'an' object of that class (which most probably is identical to other objects - that's why it is called 'factory').
Correct me if I'm wrong.
Actually, I suspect you are. The Factory pattern is used to
defer the decision on what class gets created to subclasses by overriding a factory method, usually defined in an interface. AbstractFactory, in the words of Wikipedia: "provides a way to encapsulate a group of individual factories that have a common theme".
What neera has written is a simple dispatcher and, as such, I'm not sure whether it qualifies for any pattern.
Winston