Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a .NET (C#) application that I am releasing soon, which also has some support files. Right now I am storing those files as .txt files, and I update them as necessary whenever the application version changes. I am wondering if a better solution might be to store the information in those files in a central database instead, and have all clients access that database when then launch. This would prevent the need to update the software each time those reference files change.

My question for the gurus here is this: Is this a wise decision, and if so...what would be the best method of storing the downloaded data? A temp file? in memory? something else? Any help would be appreciated.

share|improve this question
2  
If you have code that works with txt files, don't rewrite it unless you have need of a new feature that is hard to implement currently. –  Joel Coehoorn Mar 4 '13 at 17:24
    
@Jeagr Are talking about a windows or WPF app where it is installed on the individual clients? Or a web app that has multiple instances? –  DavidEdwards Mar 4 '13 at 17:32
    
If they are support files, could you not store the data for them in your app.config or web.config? –  Mikey Mouse Mar 4 '13 at 17:36
    
My application is currently based on a Windows Form app. The support files themselves are very similar to dictionaries, except specific to my application. My main concern is that I add to these dictionaries as I need to , and I am contemplating allowing the clients to add to the dictionaries as well. –  Jeagr Mar 4 '13 at 17:41
1  
You can also maintain a file version in your server for example and every time your app is launched it will check if you have the most updated data, if not you retrieve it and store it in a specific folder to your app. –  polkduran Mar 4 '13 at 17:49
add comment

migrated from stackoverflow.com Mar 7 '13 at 1:22

This question came from our site for professional and enthusiast programmers.

2 Answers

Keep things simple:

Your application already works with text files, no need to change any of that. Once, on startup, pull a file from your central server that just has a simple version number in it. If the version has increased, pull down the updated files.

All of your currently existing code doesn't change. The logic on startup is dead simple, and shouldn't take more than a few hours to implement. And best of all, if your server is down for some reason, the app can still function.

share|improve this answer
add comment

I would strongly suggest breaking this into a generic subcomponent of your application suite. I solved this a while back with a very small loader app that contained thoroughly tested logic that checked a url defined in the registry. With a series of registry keys for version info of components and a web service that contains patching logic you can optionally check for updates on load. The main benefit of a loader is that it can update multiple applications with the logic to update application deployed at a later time.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.