A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I want to build a generic RSS feed generator that will allow me to call it via a URL like rss.aspx?feed=n (where n is the feed id) which will in turn use a small database to hold the meta information to produce the RSS feeds.
The code for creating the feed is trivial as is the code for database access to the systems from which I might pull the feed's content data, but what I really need some help/guidance on is from a slightly higher level about the framework for a templated RSS feed generator.
My RSS feed database will need columns to define what database to connect to, database type (SQL Server, Oracle or something else), a column to hold the SQL statement or stored procedure names and a mechanism to define what elements from the SQL statement will go into the RSS feed's various elements (TTL, title, link, description, etc.).
I could store the SQL in a column, say somthing simple like this
SELECT title, content, UPPER(c) FROM table WHERE d >= DATEADD(d,-7)
And then have a template for the RSS like this
In which I can simply replace the tokens with field values?
I can try and perform any functions on the columns within the SQL but what if I want to do something "exotice" to a column via a .NET function that perhaps I can't easily perform via SQL? How could I execute .NET code in my RSS "template"?
Can anyone provide any advice on how best to flexibly approach this project so that I can add new feeds simply by adding a few fields to my RSS meta database to define source SQL statement and appropriate RSS feed element mapping?
It maybe that this SQLStatementColumn, RSSTemplateStringColumn solution is a poor one and there's a better, more flexible way of doing this?
Are there any Design Patterns that you'd suggest would be useful for any part of this project?
Thanks for your time.
There a couple ways that I've seen this done in .NET shops:
1) Use a templating engine like NVelocity or Maverick.NET to create the xml for the rss feed.
NVelocity - http://www.castleproject.org/others/nvelocity/
Maverick.NET - http://mavnet.sourceforge.net/
2) Use XSL to transform the results from the database into a rss format.
My last personal project was creating a rss feed for Subversion check-in log. I used the Argotic framework, and let it convert my data into a rss feed. This framework has a very easy to use API. I was able to get a decent looking feed in a couple hours.
Argotic - http://www.codeplex.com/Argotic
Hector Sosa, Jr - PainlessSVN
Thursday, July 10, 2008
I was going to suggest using ASCX + Repeater control
ASPX -> RSS Feed
Contains a repeater
Based on the parameters, get your data for the specific feed.
One of those can be a reference to an ASCX control to load into the repeater. The ASCX is then responsible for fotmatting, etc, and you can inline code into it as required.
Thursday, July 17, 2008
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz