Factory Building?

Hi all,
I'm having such a hard time grasping onto Factory. Can anyone help me or point me to a good source? I've been looking up on this online and it seems to be very confusing. Will anyone be able to clearify this for me?

Would anyone be able to supply a simply example and how to use it?

Thanks in advance
seanD
Its about creating different objects (the factory) and the client don't have to care about how its going on.

http://msdn.microsoft.com/en-us/library/ms954600.aspx
http://en.wikipedia.org/wiki/Factory_method_pattern
http://en.wikipedia.org/wiki/Abstract_factory_pattern



I hope this will be enough else read Design Patterns - erich gamma. :)
Thanks for your reply Writetonsharma,

Sorry but i'm a total complete noob at factory building and i just can't get a grasp on it. Is there any ways that you can show me in codes?
Both the provided wiki links provide some pretty concise sample code, albeit in Java and Python. The basic design principles are the same though, and it's only the specific language syntax that will vary, and there's not that much difference in the provide sample code between Java and C++).

If you're having trouble grasping those samples, it may be more a matter of not having a full grasp of the underlying OO concepts involved. Class interfaces, inheritance, polymorphism, base classes, abstract classes, concrete classes. If you don't have a solid grasp of OO in general, then trying to understand the design patterns that build upon OO is putting the cart before the horse.
Topic archived. No new replies allowed.