Back to list
Views:   0
Replies:  0
Reply 1
Thank you @Bhupendra & @Amlan for your time and suggestions.

The strategy pattern suggestion was a good one that I hadn't looked into. I figured for my situation I'll need a combination of Abstract Factory (where whole semantics of the files change) and Strategy Pattern (when there are minor additions/subtractions to the file).

In this particular scenario I think Interface is preferred, as I want to just lay out the contracts.
Justin Chuck, Jun 24, 2010
Reply 2
As per the problem statement and the points:

a.) Check the version of the software emitting XML files and call the appropriate Parse routine, say Version1.Parse() or Version2.Parse(), that then calls the parse routine of different files, like ParseFileA() or ParseFileB().

b.) There is a possibility that of the 20 XML files, syntax for only 5 of them has changed (ver 1.1) and rest remain the same. In that case, I would like to call the different file parsing routines. I guess, I should be able to call the appropriate method based on the version read in the previous step through a conditional branching (just wanted to let know).

I believe the solution should address the futuer versions also, cause sometime we can't even predict the extension points of a solution, so its better to keep it open.

I believe using Abstract Factory will be the most appropriate solution. Regarding the decision of using interface and Abstract class I always use interface whenever I want to make a behavioral contract and when there is a need for code re usability as well as creating a behavioral contract better to use Abstract Classes.
Amlan Sengupta, Jun 23, 2010
Also, do not forget KISS (Keep It Simple Stupid). Check this link:
May 19, 2010
Reply 3
After reading the description above, I understood there are different algorithm for reading different XML files.I think you should investigate more on strategy pattern.I think this fits to your requirement.

see this link

Before coming to conclusion, I would suggest you to read some other post as well on other sites.Take careful decision.
Bhupendra Sinha, Jun 11, 2010
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