Back to list
Views:   0
Replies:  0
Reply 1
Hi Stuart,
First of all, I don't thing that a Factory Method, will help you in the case that all sub-clases are different, factory is only good if all returned instances share the same interface.

What may help you here is to implement the same interface in all subclases. 

For example create a dictionary of properties in the base class and all derived classes implements a "public object GetProperty(string name);" method and also a ReadXml() abstract method, so each XmlMapper knows where to read the properties.
So your "Factory" should instantiate a sub-class that reads the Xml and set its own property's dictionary.

I hope this helps you a little bit.
Diego Barnech, May 11, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas