I've never really looked at the Factory pattern and today decided to take the time and create a quick sample based on this article (http://msdn.microsoft.com/en-us/library/ee817667.aspx), to finally get my head around it.
The source code works perfectly arranged in three separate assemblies neatly named Product, Factory and Client.
The main benifit (as I understand it) for the Factory pattern is to abstract the instantiation of the "product" class from the "Client" class. So in the provided example, the Product instantiation never changes irrespective of any changes made to the product class, you still have to make changes to the client class to pass zin new values required to create your updated product. This data after all must come from somewhere?
Another example I read stated that once a class is implemented and loads of other classes make use of it directly, changes made to the "product" class here, would require changes to be made to every instantiation of this class, say for example if a new variable was required in its constructor.
From what I can understand, the Factory pattern does make sure the instantiation of this class never changes, if you want to pass a new variable to the products constructor, you simply end up having to pass those new variables to the updated factory instead.
This is therefore clearly not solving the problem but merely moving it and in doing so adds additional complexity.
Given that this is an established pattern, I'm obviously missing something. Hence this post: Please explain to me what I am missing.
Thanks