Generic Data Store
After giving it more thought, I decided to make some significant changes to the picture from the previous post. Main reason is that I wanted to make settings layer a thing on its own. Make it more generic and flexible.
With this new approach, extension would be shielded from any changes by manager, while widgets, themes etc. can go straight to the DataStore object and get/save settings there. From the beginning, it would handle common data types like XMLDocument, Dictionary, ExtensionSettings and can be extended to use any data type in the future. Data providers will be responsible for saving and retrieving objects from the XML or database. Client code would look something like:
XMLDocument settings = new XMLDocumnet();
// build document
DataStore.Save(“MyWidget”, settings);
XMLDocument settings = DataStore.GetSettings("MyWidget");
Or even cooler:
grid.DataSource = DataStore.GetSettings("MyTable");
I will code proof of concept this weekend. Obviously, this is not enough to keep me occupied – alongside with this endeavor I started another one – transforming mp3player into a full blown podcasting extension. Not sure where it will bring me, one thing guaranteed – I’m not going to be bored to death any time soon ;)