views:

194

answers:

5

I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's.

I was thinking of two things.

  • A plaintext file where each url is a single line
  • SQLite where i can have unique ID's and descriptions following the URL

Is the SQLite idea to much of an overhead or is there a better way to do things like this?

+2  A: 

Why not XML?

If you're dealing with RSS anyway you mayaswell :)

Cetra
+2  A: 

What about as an OPML file? It's XML, so if you needed to store more data then the OPML specification supplies, you can always add your own namespace.

Additionally, importing and exporting from other RSS readers is all done via OPML. Often there is library support for it. If you're interested in having users switch then you have to support OPML. Thansk to jamesh for bringing that point up.

Jonathan Arkell
Import and export from other RSS readers is all done via OPML. Often there is library support for it. If you're interested in having users switch then you have to support OPML.
jamesh
@jamesh Very nice comment
Ólafur Waage
Agreed, thanks for filling in the details Jamessh..
Jonathan Arkell
+1  A: 

Do you plan just to store URLs? Or you plan to add data like last_fetch_time or so?

If it's just a simple URL list that your program will read line-by-line and download data, store it in a file or even better in some serialized object written to a file.

If you plan to extend it, add comments/time of last fetch, etc, I'd go for SQLite, it's not that much overhead.

kender
Thanks for that, i will probably extend it by quite a bit.
Ólafur Waage
A: 

If it's a single user application that only has one instance, SQLite might be overkill.

You've got a few options as I see it:

  1. SQLite / Database layer. Increases the dependencies your code needs to run. But allows concurrent access
  2. Roll your own text parser. Complexity increases as you want to save more data and you're re-inventing the wheel. Less dependency and initially, while your data is simple, it's trivial for a novice user of your application to edit.
  3. Use XML. It's well formed & defined and text editable. Could be overkill for storing just a URL though.
  4. Use something like pickle to serialize your objects and save them to disk. Changes to your data structure means "upgrading" the pickle files. Not very intuitive to edit for a novice user, but extremely easy to implement.
Phil
A: 

I'd go with the XML text file option. You can use the XSD tool built into Visual Studio to create a DataTable out of the XML data, and it easily serializes back into the file when needed.

The other caveat is that I'm sure you're going to want the end user to be able to categorize their RSS feeds and be able to potentially search/sort them, and having that kind of datatable style will help with this.

You'll get easy file storage and access, the benefit of a "database" structure, but not quite the overhead of SQLite.

Dillie-O