How to store end edit my configuration file



I have an application (split in different websites that share the same data) that contains thousands of products in different categories. Every category has its features, and to describe them I have used an XML file, embedded in a class library. Its format is like that:



<category code="" name="">
<featureGroup code="" name="">
<feature code="" name="">
<feature code="" name="">
<feature code="" name="">
</featureGroup>
</category>


This is overly simplified, my real files are much more complicated than that. The problem with this approach is that I have to recompile every time I have to make a change and redistribute my library to every different website.


So I made the file a standalone XML file, but also with this approach I have to redistribute the file every time I make a change.


So I converted my XML file in many tables and store these informations in a Sql database, but this approach has many disadvantages: it's far less flexible because if I make a change in the structure of the file I also have to change tables, relationships, stored procedures, etc... another problem is that XML works well with sorting. If I want to change the order of my features I just have to cut and paste a line in a different positions, if I try to do the same in my database I have to add a Position column and then provide some tool to reorder items and that's really a great mess.


I don't know how to solve this problems, I really like the flexibility of XML, I like the possibility of accessing my database anywhere from every web site, but I can't find a way to merge these two approaches.


Thank you very much and sorry for my rusty english!


No comments:

Post a Comment