I just created a new home page for LuifIT.net using the RssToolKit to aggregate my wife’s and my blog to the home page. Beyond just using the RssToolkit I also decided to use the new SiteMap and Themes available in .NET 2.0. Below is my experience with the RssToolKit.
Scenario:
Aggregating multiple feeds to a single web page and providing an rss feed of the aggregated feeds.
Working with the Rss Toolkit:
It started out very well. I ended up refactoring three times each because I found a better way to leverage the RssToolKit. One very nice feature is the RssChannel supports the loading of multiple feeds; perfect for my scenario. Since the RssChannel holds all it’s items in a List<T> it is sortable, so after loading multiple feeds it was easy to sort them according to date.
The RssDatasource is a great idea with a couple big limitations. One, you can not set the Channel of the datasource in code. So I went to change the code to allow the setting of the channel and noticed that it is using the GenericRssChannel which derives from the RssChannelBase. Long story short when the RssToolkit is used to generated types classes for your feed the gen’d channel derives from RssChannelBase not GenericRssChannel. So if you gen using the toolkit the resulting code is incompatible with the RssDatasource. It would nice to have an interface extracted out of the RssChannelBase class and have the RssDatasource use this for the Channel property. Being able to gen typed classes is very nice and one addition that would be helpful gening these classes as partial.
RssChannelBase uses the XmlDocument to build the xml to render for the feed when using the RssHyperlink. This is a fine idea if you do not need namespaces and prefixes but I did not find a way to include prefixes using the XmlDocument. I changed the use of the XmlDocument to use an XmlTextWriter so it is possible to include prefixes. This was only half the battle as the root “rss” element was created as empty. I needed to have all the same namespaces as the original aggregated rss feeds. I ended up saving off the original root rss node and checking to see if it was empty or not. This allowed me to have prefixes and all the correct namespaces.
I see many easy refactorings that could be done to tighten up the code of the RssToolKit. The decoupling of specific classes would of eventually fall out with some unit testing. I looked at the Rss Framework on the code project for a few minutes and it looks pretty nice as well though it is built on .NET 1.1. I think the RssToolKit has a lot of great potential and will eventually get there as time will permit. Thanks for making the RssToolkit Dmitryr!
Remember Me
Powered by: newtelligence dasBlog 2.1.8102.813
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts